Reputation: 826
Just what the title says. I am getting this error thrown and not sure if this has to do with the Swift 4 conversion. I have been trying to work around the code but no luck yet so decided to throw this question up on SO. This error is getting thrown on line: "cell.businessPostImage.setImageWith(postRequest,". Thanks.
cell.businessPostImage.image = nil
if let postURL = URL(string: downloadURL) {
let postRequest = URLRequest(url: postURL)
cell.businessPostImage.setImageWith(postRequest, placeholderImage: nil, options:
{ (imageRequest, imageResponse, image) in
cell.businessPostImage.contentMode = UIViewContentMode.scaleToFill
cell.businessPostImage.image = image
}, completed: { (imageRequest, imageResponse, error) -> Void in
// failure downloading image
print("Error downloading Firebase post image")
print(error)
})
}
Upvotes: 0
Views: 5921
Reputation: 7485
You have to use like this :
if let postURL = URL(string: downloadURL) {
let postRequest = URLRequest(url: postURL)
cell.businessPostImage.setImageWith(postURL, placeholderImage: nil, options: SDWebImageOptions.ProgressiveDownload, completed: { (imageRequest, imageResponse, error) -> Void in
// failure downloading image
print("Error downloading Firebase post image")
print(error)
})
}
Upvotes: 1