Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mazharulbelal/8d84a3713e4446a710dbfedbed3617cd to your computer and use it in GitHub Desktop.
Save mazharulbelal/8d84a3713e4446a710dbfedbed3617cd to your computer and use it in GitHub Desktop.
Load image from url with placeholder image SDWebImage extension swift
extension UIImageView {
func downloadImg(_ url: String) {
let afterRemovedSpaceImgPath = url.replacingOccurrences(of: " ", with: "%20", options: .literal, range: nil)
self.sd_imageIndicator = SDWebImageActivityIndicator.gray
self.sd_setImage(with: URL(string: afterRemovedSpaceImgPath), placeholderImage: UIImage(named: "PlaceHolder"))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment