Is there an ActivityIndicator (or something like it) in WatchKit for Apple Watch? How do you all give the user feedback about some longer lasting background activity?
There is no method for displaying ActivityIndicator in WatchKit Framework. However you can prepare some circular image and easily create infinite animation yourself.
Prepare images and name them like this
frame-0, frame-1, frame-2...frame-n
and then in your code:
[self.yourInterfaceImage setImageNamed:@"firstFrame-"]; //setting first frame
[self.yourInterfaceImage startAnimatingWithImagesInRange:[self.model imageRange]
duration:0.4
repeatCount:0];
// [self.model imageRange] will return NSRange from 0 to n
// repeatCount == 0 means infinity. Of course you can set some limit, like 100.
Hope this helps.
watchKit do not have indicator object. so use image to show indicator. Add your image in assets
And use this code to start animate image
image.setImageNamed("Small_Indicator")
image.startAnimatingWithImages(in: NSMakeRange(0, 39), duration: 1.0, repeatCount: 0)
And use this code to stop
image.stopAnimating()
image.setHidden(true)
Refer the link and Use this sample project to show indicator https://github.com/Abishekt97/AppleWatchIndicator