Coder Social home page Coder Social logo

Comments (6)

dalu93 avatar dalu93 commented on July 20, 2024 5

+1

@x1024 I solved with a simple workaround. After each loop is finished, it calls the loopCompletionBlock on the FLAnimatedImageView instance. I have simply implemented it like

private func finishedLoop(remainingLoops: UInt) {

    imageView.stopAnimating()
}

from flanimatedimage.

DuongQuangLoc avatar DuongQuangLoc commented on July 20, 2024 3

@dalu93
In swift 3
self.imageView.loopCompletionBlock = { (uint: UInt) -> Void in
// unit is the loop time of image.
self.imageView.stopAnimating()
}

from flanimatedimage.

raphaelschaad avatar raphaelschaad commented on July 20, 2024

Hi – thanks for opening this issue.

I'm not convinced yet that making the immutable properties of a GIF writable is the best way to go. Consequently, the same would have to happen e.g. with delay times.

Here is an approach with a loop completion block: https://github.com/Flipboard/FLAnimatedImage/pull/60/files

I'll think more about it. Any input is welcome!

from flanimatedimage.

cemo avatar cemo commented on July 20, 2024

#60 seems like a natural fit. Any chance to merge it?

from flanimatedimage.

x1024 avatar x1024 commented on July 20, 2024

I would second making the loop count and delay times writable. I tried several different methods to make a gif not loop. It works in a browser, but not in FLAnimatedImage.
I'm not placing any blame in FLAnimatedImage, because GIF is perhaps a more complex standard than is reasonable.

But it would save a great deal of hair-pulling if I could just set an integer property, instead of wrestling with command-line tools that cater to an arcane spec.

from flanimatedimage.

dharmendrajadav avatar dharmendrajadav commented on July 20, 2024

@dalu93 How to use loopCompletionBlock in swift 3?

from flanimatedimage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.