yeatse / KingfisherWebP

Elegantly handle WebP format with Kingfisher.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can i known the webp which is animated play complete

yaotiancheng-ola opened this issue · comments

How can i known the webp which is animated play complete

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")
    }
}