all
I am learning Swift and I am trying to set an image on 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 the following:
SUCCESS: <UIImage: 0x7fb0c3ec3d30>, {512, 286}
My objective is to do something with the image once is downloaded, but the problem is that I don't understand the signature for the completion callback and I don't know how to access to the image in the completion block. According to the documentation, is Result<UIImage, NSError>
.
I guess is something really simple, but I am not realizing it.
Thanks