Post

Replies

Boosts

Views

Activity

Reply to Xcode 12.4: Image Literal returns error message
Hi, I found this from Udemy Lesson Q&A from a user name LEE. This solution works for those of us who just starting to learn Swift. Thank you to LEE and would like his permission to share his answer below. Thanks again Lee. Rick Hi @Oleksandr, I had the same issue with Xcode 13 also as it wasn't coming up in the dictionary suggestions when typing 'image literal'. I've found that if you type the following then it will work and present you with the image icon and let you select the image as Angela has shown: diceImageView1.image = #imageLiteral( As soon as you type the trailing '(' then it will change to an image icon and let you select the DiceSix image. Hope that helps! Cheers, Lee
Oct ’21
Reply to Xcode 12.4: Image Literal returns error message
Hi, I searched the Web and found the temporary fix for this . diceImageView1.image = UIImage(named: "DiceSix") diceImageView2.image = UIImage(named: "DiceTwo") You might need to play around with the brackets " ( " ( delete them and putting them back and see what happen. Xcode is being naughty sometimes. ). I reloaded my Project by recloned it again from Github and started the same procedures over. It seemed to work for me. However, for the following lessons where you will have to put these images in the arrays, I will need to try and perhaps search for solutions otherwise the line of code will be very long. If you have the solutions, I would appreciate if you can share. Rick
Oct ’21