I have 3 short questions, very related:
-
How do i detect if the user is using a retina device?
-
I want to save an image inside my app in documents, if i detect that they’re using a retina display phone and save the image ending in
@2x.jpgwill it work as it does with imported images, where it’ll automatically go for that one instead on a retina device? -
If i were to reference an image which didn’t exist, but a
@2x.jpgversion existed, would it go to that by default?
[UIScreen mainScreen].scale, it’s2.fwhen it’s a retina screen.@2x-versions here too (as long as you useUIImageto load them).@2x-version first, if it doesn’t exist, it’ll fallback to the default-version. If that version doesn’t exist, it’ll returnnil. A non retina screen however, will never look to the@2x-version.You call it a
x2.jpg-file, however, it isn’t:background.png.background@2x.png.UIImage *image = [UIImage imageNamed:@"background.png"];.