Jacksonkr
Jacksonkr

Reputation: 32207

ios logic for a retina screen

For just about everything I use image.png and [email protected] which the device always uses the right image at the right place.

However, I'm manually adding SOME images like so:

theImage = [UIImage imageNamed:@"image.png"];

How do I decide if I need an @2x image or not?

Upvotes: 1

Views: 318

Answers (1)

Macmade
Macmade

Reputation: 53930

You don't...

iOS will automatically look for @2x images, when using imageNamed:.

Note: if you need to know if the current device has a retina display, for another purpose, you may use [ [ UIScreen mainScreen ] scale ]:

UIScreen Class Reference

Upvotes: 5

Related Questions