I am currently working on a project which depends heavily on GIFs. However, I never worked with GIFs in Swift for iOS before an I am pretty lost.
The first thing I tried was to import some GIFs to my Assets.xcassets
folder. I realised that using an ImageSet for GIFs does not work.
So my first Question: How do I import GIFs into my project? And should I use only one resolution or are three the better way like for images?
Then I already checked out some questions about presenting a GIF inside a UIImageView
, programmatically and via Storyboard. As I figured out, this is probably best possible by using an extension for the UIImage
class. However, the Swift 4 examples didn't work for me because of some reason.
So my second Question: How do I use the imported GIFs inside my project and display them inside a UIImageView
programmatically?