Apple Watch animation broke after 1.0.1

I had an animation in WKInterfaceImage inside WKInterfaceTable :

 [[self.table setNumberOfRows:1 withRowType:@"Loading"]; WatchLoadingCell *cell = [self.table rowControllerAtIndex:0]; [cell.image setImageNamed:@"spin"]; [cell.image startAnimating]; 

My images named spin0 are spin30 and are added to the target of the watchKit application.

when the application starts, the image is static, i.e. only spin0 is displayed

any ideas why?

EDIT: it works in the simulator, but not on the device itself, it only works on the device when I reload the view by calling [self awakeWithContext:nil]; from my Force Touch menu

I also tried running the animation in willActivate with no luck

+6
source share
1 answer

When setting up animated images in code, use startAnimatingWithImagesInRange: duration: repeatCount: method

 [cell.image setImageNamed:@"spin"]; [cell.image startAnimatingWithImagesInRange:NSMakeRange(0, 30) duration:10 repeatCount:0]; 

If you call the startAnimating method, the duration set in IB will be used

IB screenshot

+2
source

Source: https://habr.com/ru/post/988075/


All Articles