I am using SDWebImage latest updated version & it works good so far. Recently I found one issue which started causing the crash issue into my Application.
I observed that if Image URL having a Alphabet in Spanish then its unable to download & generates the nil exception. This later on coverts into the crash issue.
Here how I used it :
cell.imgView.sd_setImage(with: URL(string: imString)!) { (img, error, type, url) in
cell.imgView.image = img?.resizeTopAlignedToFill(newWidth: collectionView.frame.size.width)
cell.imgView.contentMode = .top
}
This kind of URL where image name is having Spanish Alphabet do not works :
Important Note :
Please help me out if someone has found any solution to resolve this issue.
Any suggestions will be highly appreciated.
That is not a proper URL. Try changing your url string by adding utf encoding.
cell.imgView.sd_setImage(with: URL(string: imString.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)!)!) { (img, error, type, url) in
cell.imgView.image = img?.resizeTopAlignedToFill(newWidth: collectionView.frame.size.width)
cell.imgView.contentMode = .top }