I\'m using SDWebView image and i want to show an Activity Indicator as placeholder, while fetching the image from remote.
I tried Malek\'s answer here How to show an act
SDWebImage has a built in Acitvity Indicator that works perfectly. Try this:
Updates: SWIFT 5 SDWebImage 5.x.x
imgView.sd_imageIndicator = SDWebImageActivityIndicator.gray
imgView.sd_setImage(with: url, placeholderImage: UIImage(named: "placeholder"))
Swift 3:
imgView.setShowActivityIndicator(true)
imgView.setIndicatorStyle(.gray)
imgView.sd_setImage(with: URL(string: urlString), placeholderImage: UIImage(named: "placeholder"))