Reputation: 217
I am trying to send about 30 images to the apple watch from an iPhone 6 to create an animation. To do this we tried creating an animation sequence, and also loading the images into an array. In both cases it is incredibly slow to load the images (around 60 seconds or so) over the bluetooth connection and it seems to crash the apple watch app about every other time. Does anyone have any ideas on how to force the watch to connect to wifi to send the images or any other method to speed the process up? Or are we going to have to wait for apple to make the technology better?
Upvotes: 1
Views: 450
Reputation: 5365
I suggest resizing your images to the minimum that you can live with, and one good tip is sending an NSData representation of the images and then initialize the image with the data using on the watch:
WKInterfaceImage
- (void)setImageData:(NSData *)imageData
So in your case, I would use:
UIImage
+ (UIImage *)animatedImageWithImages:(NSArray *)images
duration:(NSTimeInterval)duration
And then turn that into an NSData instance using NSKeyedArchiver
to send to the watch.
And on the other side:
WKInterfaceImage
- (void)startAnimatingWithImagesInRange:(NSRange)imageRange
duration:(NSTimeInterval)duration
repeatCount:(NSInteger)repeatCount
Upvotes: 1