apple watch - slow image animation first time apple watch - slow image animation first time swift swift

apple watch - slow image animation first time


I ran into the same issue as you.

This happens because on the first time you try it, the watch takes time to load the images. Also apple doesn't give us any 'pre load' method, so I came up with a little work around it:When my controller will be displayed:

func willActivate()

I play the animation sequence once in a background tread, this way when my user clicks on it the images are already loaded.

        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT,     0)) { [weak self] in            if let uSelf = self {                uSelf.statusAnimationImage.setImageNamed("my image name")                uSelf.statusAnimationImage.startAnimatingWithImagesInRange(NSMakeRange(0, 359), duration: 0.5, repeatCount: 1)            }        } 

That was the best way I found to solve this problem and it works for me.


try doing

 group.setBackgroundImageNamed("show_back-"); let delayTime = dispatch_time(DISPATCH_TIME_NOW, Int64(1.5 * Double(NSEC_PER_SEC))) dispatch_after(delayTime, dispatch_get_main_queue()) { () -> Void in        self.animateWithDuration(1) { () -> Void in             group.startAnimatingWithImagesInRange(NSMakeRange(0, 39), duration: 1.5, repeatCount: 1);             self.label.setAlpha(1)        };    };

I'm not exactly sure what you're doing but also try doing animateWithDuration(0) or (1.5)