Strange.. something simple that is in the docs doesn't seem to work with Swift. See below code. Where exactly is "SDWebImageRefreshCached" when using Swift??
self.profileImageView.sd_setImageWithURL(profileImageUrl, placeholderImage: UIImage(named: "default_profile_image"), options: SDWebImageRefreshCached)
In Swift, the enums are exposed slightly differently.
You would be looking for SDWebImageOptions.RefreshCached
, or .RefreshCached
for short.
Your line of code thus would be:
self.profileImageView.sd_setImageWithURL(profileImageUrl, placeholderImage: UIImage(named: "default_profile_image"), options: .RefreshCached)
You can try this code:
.RefreshCached is change to .refreshCached in SDWebImage 4.0.0
//SDWebImage 4.0.0
self.profileImageView.sd_setImage(with: yourImageUrl, placeholderImage: UIImage("Your placeholder image name"), options: .refreshCached)