I'm fairly certain on how to create an array of images using UIImage, but I cannot find any instructions on how to reference those array images with a for loop, my code attempts always produce an error that says uiimage is not convertible to int.
I want to iterate through the array, then display each image in sequence:
var imageArray: [UIImage] = [
UIImage(named: "image1.png")!,
UIImage(named: "image2.png")!
]
for element in enumerate(imageArray) {
imageLabel.image = (imageArray[element])
}
The idea being, a sequence of images will display on the iPhone (either automatically or by press of button).
I know this is incorrect code, but I wanted to give the gist of what I'm trying to do, I know there are better ways to do the same thing, but I'm trying to learn the limits and capabilities of swift code, and I do that by trying various ideas (good or bad) that come to my head as I learn each aspect of swift. Thanks in advance!