Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Image Literals No Longer Autocomplete #15

Open
ghost opened this issue Nov 16, 2021 · 7 comments
Open

Image Literals No Longer Autocomplete #15

ghost opened this issue Nov 16, 2021 · 7 comments

Comments

@ghost
Copy link

ghost commented Nov 16, 2021

If you are having difficulty getting image literals during the section of the class where you change the dice images in code, it's because Xcode 13 no longer autocompletes Image Literals. There is a quick workaround.

When you type diceImageView1.image =
follow it with #imageLiteral(

As soon as you type the left parenthesis, it will autocomplete a image literal, that you can set according to the instructions in the video.

@poskreepta
Copy link

thanks!

@brianail
Copy link

Thanks :)

@latosal
Copy link

latosal commented Jan 20, 2023

thanks a lot

@SuZiVogue
Copy link

thanks!

@danakayone
Copy link

thanks

@weedsrb
Copy link

weedsrb commented Nov 5, 2024

Hello, does anyone know how does it work on Xcode 16.1?

@brianf1408
Copy link

It worked for me in Xcode 16.1 as described by ghost.
fyi. if you comment out the line of code with the 'dice' icon it changes to ....
// diceImageView1.image = #imageLiteral(resourceName: "DiceTwo")
alternatively in Xcode 16.1, if you start typing imageL... (just after the = sign), it autocompletes to ....
diceImageView1.image = UIImage(imageLiteralResourceName: String)
where you then have to manually change String to the name of the image you want, i.e, "DiceTwo"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants