Created
May 12, 2022 08:04
-
-
Save mazharulbelal/8d84a3713e4446a710dbfedbed3617cd to your computer and use it in GitHub Desktop.
Load image from url with placeholder image SDWebImage extension swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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