I am using the SDWebImage plugin on Xcode for my images but I need to add an alpha effect (transparency) to it but it won't recognize the property.
I know I can do something like this for a regular UIImage and it would work...
posterBackground.image = UIImage(with: URL(string: movieImage!)!.alpha(0.15)
But trying the same with the SDWebImage plugin in doesn't works...
posterBackground.sd_setImage(with: URL(string: movieImage!), placeholderImage: UIImage(named: "poster-placeholder"))!.alpha(0.15)
It gives me the error "Value of tuple type 'Void' has no member 'apha'". Is there some way that allows me to use the plugin and apply the alpha property to the image?
Thanks in advance.
Thanks to @Happiehappie 's comment and also this answer from another post I was able to apply the alpha property. Here is the final working code...
posterBackground.sd_setImage(with: URL(string: movieImage!), placeholderImage: UIImage(named: "poster-placeholder"), options: SDWebImageOptions(rawValue: 0), completed: { (image, error, cacheType, imageURL) in
self.posterBackground.image = image?.alpha(0.15)
})