Search code examples
swift3sdwebimage

Ambiguous use of `setImageWith(_:placeholderImage:usingActivityIndicatorStyle:)` in Swift 3


This Code working fine in Swift 2.3, but while i am upgrading to Swift 3.0, compiler complains about ambiguous use.

imgProfilePhoto?.setImageWith((URL(string: profileurl)), placeholderImage: UIImage(named: "PatientDefaultProfilePic"), usingActivityIndicatorStyle:UIActivityIndicatorViewStyle.gray)

Solution

  • Swift equivalent method works as replacement of this method from SDWebImage :

    imgProfilePhoto?.sd_setImageWithIndicator(with: URL(string: profileurl), placeholderImage: UIImage(named: "PatientDefaultProfilePic"))