Search code examples
swiftanimationstoryboard

How to animate a ui view repeatedly with IBAnimatable library


I am using IBAnimatible library to animate a simple UIView using storyboard

When I run the app, the animation (Flash) runs only 2 times and then stops.

How to animate (forever) or repeated 100 times for example.

I cannot find any repeat field

enter image description here


Solution

  • It seems that the Animatable protocol has a property called repeatCount, which is "used to specify the count to repeat the animation.". Why not create a custom UIView that conforms to Animatable and set repeatCount to Float.infinity? repeatCount is compatible with the flash animation. If you provide some more context as to what you are wanting to animate, I could provide some code as to how you could do this.