everything
I am learning Swift and I am trying to set an image in a UIImageView using AlamofireImage. I am using the following code:
self.listImageView.af_setImageWithURL( NSURL(string: list!.image!)!, placeholderImage: nil, filter: nil, imageTransition: .CrossDissolve(0.5), completion:{ image in print(image) } )
and the result in the console is as follows:
SUCCESS: <UIImage: 0x7fb0c3ec3d30>, {512, 286}
My goal is to do something with the loaded image, but the problem is that I don’t understand the signature for the completion callback, and I don’t know how to access the image in the completion block. According to the documentation, Result<UIImage, NSError> .
I think it’s really easy, but I don’t understand it.
thanks
ios alamofireimage
estemendoza
source share