borisy borisy - 1 year ago 90
Swift Question

startAnimatingWithImagesInRange is not completing

I need to animate series of images.

// Animate Circle
let duration = 1.0
circleGroup.startAnimatingWithImagesInRange(NSRange(location: 0, length: 100), duration: duration, repeatCount: 0)

gif animation shows animated circle which animates from 0% to 45% of its radius

I have 101 images. From arc0 to arc100.

Xcode screenshot with images in the folder.


storyboard with the watch app UI

As you can see on the gif, my problem is that animation doesn't make full circle trip. Any suggestion?

Answer Source

Looks like animation is stopping right after 40%. I opened asset library and renamed every file to the exactly same name. Then I opened my Git client and I saw this changes:

Animation now works. As you can see, problem was in a file name, it had extra space in it.

Also I learned that when doing backward animation location becomes not the starting point but the destination.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download