WatchActivityIndicator
Apple Watch WKInterfaceImage
and WKInterfaceGroup
extension for showing activity indicators on them quickly.
Demo
Requirements
- watchos 2.0+
- Swift 5.0+
- Xcode 10.2+
Install
Cocoapods
target 'your_watch_extension_target' do
platform :watchos, 2.0
pod 'WatchActiviyIndicator'
end
Usage
Call startActivityIndicator
and stopActivityIndicator
functions on any WKInterfaceImage
or WKInterfaceGroup
instance for default activity indicator.
// start
imageView?.startActivityIndicator()
group?.startActivityIndicator()
// stop
imageView?.stopActivityIndicator()
group?.stopActivityIndicator()
You can set parameters of startActivityIndicator
for custom animation sequance and duration.
imageView?.startActivityIndicator(
imageNamed: "CustomAnimation",
animationRange: NSMakeRange(0, frameCount),
duration: customAnimationDuration)
Works on any image view or group.