0

In Xcode 8, If I am using the iPhone 7's storyboard size of 414x736 and I have a UIImageView of 100x100. Because the iPhone 7 is x2, do I need to provide an image of 50x50 for x1 and 150x150 for x3? Thanks in advance.

Léo Natan
  • 56,823
  • 9
  • 150
  • 195
james
  • 353
  • 3
  • 16
  • you don't need to. You can but you don't need to. `1x` are rather rare today. – Sulthan Nov 11 '16 at 11:58
  • @Sulthan Actually, Apple requires 1x images for iPad support. Our app was rejected some time ago for not providing them. Even if the app is iPhone only, it still runs in compatibility mode on iPads. – Léo Natan Nov 11 '16 at 12:01
  • @LeoNatan Do you mean icons or all images? – Sulthan Nov 11 '16 at 12:03
  • Images, not icons. – Léo Natan Nov 11 '16 at 12:03
  • @LeoNatan Very strange, that never happened to me! – Sulthan Nov 11 '16 at 12:04
  • Related http://stackoverflow.com/questions/26092046/for-an-iphone-only-ios-7-app-can-we-include-only-3x-images/26092471#26092471 – Sulthan Nov 11 '16 at 12:06
  • When you use asset catalogs, it automatically creates missing slices from the images it has. So if only 3x is provided, it creates 1x and 2x variants inside the .car archive. – Léo Natan Nov 11 '16 at 12:15
  • I recommend to use [vector graphics](http://www.programmingcrew.in/2016/09/vector-graphics-in-ios.html). By using this, you don't need to mess with 1x,2x,3x,4x. – pkc456 Nov 11 '16 at 12:37

1 Answers1

3

If your imageView is 100*100 in storyboard (points), the recommended resolution for resource image would be 300*300 for @3x and 200*200 for @2x. If you provide only one of resolution, it will be upscaled/downscaled to fit the size.

So if you have only @3x you'll end up using more memory (2.25 times more) on devices with 2x scale.

If you have @2x only, you'll see upscale artefacts on iPhone 6/7 plus (image will be not that crisp)

alexburtnik
  • 7,661
  • 4
  • 32
  • 70