yeatse / KingfisherWebP

Elegantly handle WebP format with Kingfisher.
MIT License
306 stars 73 forks source link

How can i known the webp which is animated play complete #76

Open yaotiancheng-ola opened 11 months ago

yaotiancheng-ola commented 11 months ago

How can i known the webp which is animated play complete

yeatse commented 11 months ago

If you play animated webp with Kingfisher's AnimatedImageView, you can implement the AnimatedImageViewDelegate protocol:

class YourViewController: UIViewController, AnimatedImageViewDelegate {
    let imageView = AnimatedImageView()

    override func viewDidLoad() {
        super.viewDidLoad()

        imageView.delegate = self
        // Load your WebP image into imageView
    }

    func animatedImageView(_ imageView: AnimatedImageView, didPlayAnimationLoops count: UInt) {
        print("Animation finished")
    }
}