I know I can use the @2x tag to automatically load images for Retina screens. What other tags are supported?
I know I can use the @2x tag to automatically load images for Retina
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There are currently three supported tags:
@2xfor Retina screens.~iPadfor iPad, has to be the last tag before the extension.~iPhonefor iPhone and iPod Touch, again, has to be the last.For the splash screen there’s also the
Default-568h@2xversion for iPhone 5. This suggests that you can use-568hto automatically load images for iPhone 5, but that’s unfortunately not the case (rdar://12516489). You can patch theUIImageclass to add the support yourself.In the end there are five possible image variants:
Image.pngfor older devices, 480✕320Image@2x.pngfor Retina, 960✕640Image-568h@2x.pngfor Retina, 1136✕640, only after patchingUIImageImage~iPad.pngfor older iPads, 1024✕768Image@2x~iPad.pngfor Retina iPad, 2048✕1536All this is showcased in iOS Image Loader sample project on GitHub.