Animated Spinning Wait Images for WatchKit

There is no equivalent to UIActivityIndicatorView in WatchKit, but I have a situation where I want an Apple Watch app to display an image generated by its companion iOS app, and I want to indicate the possibility of a short wait.

Luckily, WKInterfaceImage is capable of displaying an animated UIImage. We can craft a series of images that look similar to the familiar spinning wait indicator, use them to create an animated placeholder image and simply replace it when we receive the final generated image we were waiting for.

It was a bit of an annoying distraction to have to make this, so I figured I’d share it and maybe save someone else some time. (Clarification: it started out as an annoying distraction, but I ended up enjoying writing it anyway.)

This entry was posted in Swift. Bookmark the permalink. Follow any comments here with the RSS feed for this post. Both comments and trackbacks are currently closed.