How to use images in my code (Xcode)

I am creating a quiz app and so for each question that appears I want to have an image with it, but I dont udnerstand how to use the images in my code


Here is my array for the images (let me know if there is something wrong):


    let pictures = [[UIImage(), #imageLiteral(resourceName: "americanmap")], [UIImage(), #imageLiteral(resourceName: "mapjshdjshdajldk")], [UIImage()j, #image11l(resourceName: "Thumbs_Up_Hand_Sign_Emoji_larg]]


Here is the code for switching the image when a new question appears:


        images.animationImages = pictures[currentQuestion]

I'm not sure if images.animationImages is correct


By the way, images is the outlet I created for the image


When I run this, nothing appears in the image area


Thank you!! 🙂

Is it a code you copied from some tutorial ?

What is UIImage() used for in pictures ?


There is at least an error (extra j):

UIImage()j,


that should not compile


I would try something much simpler :

let pictures = ["americanmap", "mapjshdjshdajldk",  "Thumbs_Up_Hand_Sign_Emoji_larg"]     // Added closing "
images.animationImages = #imageLiteral(resourceName: pictures[currentQuestion]]
How to use images in my code (Xcode)
 
 
Q