Flipboard / FLAnimatedImage

Performant animated GIF engine for iOS
MIT License
7.94k stars 1.22k forks source link

Gif does'nt play completely and restarts from again. #211

Open amberkatyal opened 6 years ago

amberkatyal commented 6 years ago

The gif is working fine i checked on my mac. On device the first time it completes and on second time it stops in between and restarts. It happens after every second time gif plays. Is there a property or something else?


 let url = Bundle.main.path(forResource: "loader", ofType: "gif")!
            let gifData = try! Data.init(contentsOf: URL(fileURLWithPath: url))
            let loaderGif = FLAnimatedImage(animatedGIFData: gifData)!
            let loader = FLAnimatedImageView()
            loader.animatedImage = loaderGif
            loader.frame.size = CGSize(width: 50, height: 50)
            loader.center = loaderView.convert(loaderView.center, from: loaderView)
            loaderView.addSubview(loader)