How to run a animated Gif directly by assigning it to Wkinterfaceimage using watchkit in Xcode?

1.5k views Asked by At

Here is my doubt !!!

How to run a animated gif image directly by getting dynamically from url / NSdata and assigning it to Wkinterfaceimage ???

i am working on the applewatch app development from past few days it's so great.Currently i'm working on the GIf Images assigning to the imageview. I successfuly done by adding the series of images statically in xcode and running it by assigning to Wkinterfaceimage.

2

There are 2 answers

2
Hieu Duc Pham On BEST ANSWER

Right now, Watchkit does not support to run the GIF image. So although you can download the GIF Image from url but you can't show up on the watchkit interface. to show the gif file, we have split gif file to severals images and after that we can start animated the image instead of show gif file.

1
Hawk-Eye On

Download GIF image from URL to NSData type. Then, Pass that NSData object to WKInterfaceImage setImageData method.