yeatse / KingfisherWebP

Elegantly handle WebP format with Kingfisher.
MIT License
301 stars 71 forks source link

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

Open yaotiancheng-ola opened 8 months ago

yaotiancheng-ola commented 8 months ago

How can i known the webp which is animated play complete

yeatse commented 8 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")
    }
}