Alamofire / AlamofireImage

AlamofireImage is an image component library for Alamofire
MIT License
3.99k stars 523 forks source link

Collectionview cell flicker issue when runImageTransitionIfCached = true with imagetransition is "noTransition" #479

Open bhadreshtechinnate opened 3 months ago

bhadreshtechinnate commented 3 months ago

Alamofire Environment

Alamofire version: 5.9.1 AlamofireImage version: 4.3.0 Xcode version: 15.4 Swift version: 5 macOS version running Xcode: Sonoma 14.2.1

Here is the code, I am using to set the image from url:

extension UIImageView {

    public func sc_setImage(withURL url: URL, placeholder: UIImage?=nil, filter: ImageFilter?=nil, imageTransition: ImageTransition? = .noTransition,completionHandler:((UIImage?)-> Swift.Void)?=nil) {
       // print("sc_setImage url=", url.absoluteString)
         af.setImage(withURL: url,placeholderImage:placeholder,filter:filter,
                    imageTransition:imageTransition!,runImageTransitionIfCached:true,completion:{ image in
                        completionHandler?(image.value)
            })
    }
}

When I set the image transition = .noTransition and runImageTransitionIfCached = true, at that time collectionview cell start flickering when scroll fast or switching from screen A to screen B and again come to screen A.