Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Using different images for different retina displays

I was wondering how would you serve up different quality images i.e @2x, @3x etc in swift and Xcode would you check the screen quality and change the image box or just create one image at the largest size and use this instead i'm a bit confused on this could anyone offer any insight

1 Answer

In Xcode, you can navigate to Images.xcassets. Once you are in there, click the plus icon to add a new Icon Set. There will be three boxes for orginal, @2x, and @3x sizes. In interface builder, reference the image by using the Icon Set name. Xcode will automatically choose the right resolution photo depending on what device is being used.

ahhh okay thanks