How to show activity indicator in watch kit

To show loading indicator in watch kit without using any third party, follow the below steps:-
  1. Download the images here and add them in watch kit at xcassets (MyPWatch WatchKit App -> Assets.xcassets)
  2. Add the WKInterfaceImage (named imageLoading) to your 
    WKInterfaceController
  3.  Show loading indicator as below
    self.imageLoading.setImageNamed("Activity")
            self.imageLoading.startAnimatingWithImages(in: NSMakeRange(115), duration: 3.0, repeatCount: 0)
  4. To hide the indicator, do as below:- self.imageLoading.stopAnimating()
            self.imageLoading.setHidden(true)

Popular posts from this blog

Play youtube video in iOS app

Disabling print for Production In Swift Project

Vector graphics in iOS