I followed this tutorial for adding a gif to Xcode.
I've read this classic "unexpectedly found nil" answer from start to finish. Unfortunately, I found it to be gibberish because I am a total noob*.
This is my code:
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
var imageNames = ["giphy-1 .jpg","giphy-2 .jpg", "giphy-3 .jpg", "giphy-4 .jpg", "giphy-5 .jpg"]
var images = [UIImage]()
for i in 0..<imageNames.count{
images.append(UIImage(named: imageNames[i])!)
}
theGif.animationImages = images
theGif.animationDuration = 1.0
theGif.startAnimating()
I asked Philip Lesback for help and he told me to add another ! at the end. That did not work.
*****(If it bothers you that I know nothing, please know that I've tried Code Academy, Free Code Camp, Khan Academy coding, and started multiple books but I am...hopeless, I suppose? I've tried. What seems to work best for me is video tutorials.)