How can I set an Activity indicator in SDWebImage
placeholder using UIImageView
Swift 5 & SDWebImage 5-beta
//pod file
pod 'SDWebImage', '~> 5.0.0-beta3'
//import
import SDWebImage
and set indicator and image
myImageView.sd_imageIndicator = SDWebImageActivityIndicator.gray
myImageView.sd_setImage(with: URL(string: "http://url", completed: nil)
Swift 4
imgView.sd_setShowActivityIndicatorView(true)
imgView.sd_setIndicatorStyle(.gray)
imgView.sd_setImage(with: URL(string: imageURL))
Tested and working
Swift 5
imgView.sd_imageIndicator = SDWebImageActivityIndicator.gray
imgView.sd_setImage(with: URL(string: imageURL))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With