17

I am curious what iOS devices uses @1x (I know this should be empty), @2x and @3x. When I search on here, I get uncompleted answers like: What should image sizes be at @1x, @2x and @3x in Xcode? Here I do not see the iPhone 7 or every iPad resolutions. I need to know this because my app requires image downloads and I need to know what size that image needs to be, depending on the screensize. I download it from my server and I would like to know what format (1x 2x or 3x) I should use.

Thanks.

John
  • 225
  • 1
  • 2
  • 7
  • 1
    You can use `UIScreen.main.scale` for each of the devices to figure out if it is @1x, @2x, or @3x. If you are requesting specific image sizes in code, then specify your size in code in @1x and multiply the width and height by `UIScreen.main.scale`. – keithbhunter Jun 23 '17 at 20:26
  • `OS` decide according to their scale factor , need not to worry about that – Dhiru Jun 23 '17 at 20:28
  • If I got the width and height of the screen, how would I know if it requires 1x, 2x or 3x image? – John Jun 23 '17 at 20:29
  • `let fullScreenImageWidth = UIScreen.main.bounds.size.width * UIScreen.main.scale`. Do the same for height. – keithbhunter Jun 23 '17 at 20:31
  • I suggest reading this - particularly the section titled "Points Versus Pixels" - https://developer.apple.com/library/content/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GraphicsDrawingOverview/GraphicsDrawingOverview.html#//apple_ref/doc/uid/TP40010156-CH14-SW1 – DonMag Jun 23 '17 at 20:38
  • Yes I know how big the screen is, that is not the problem.... If I got the height and if got the width, how would I know what image it requires, depening on that height and width? How would I know: O yeah this is an 1000x1000 screen, this uses a @2x image? – John Jun 23 '17 at 20:39
  • You don’t, iOS decides that for you and hands you the right image. – HAS Jun 23 '17 at 20:54
  • @HAS So only Apple knows which devices uses 2x and 3x images? – John Jun 23 '17 at 20:55
  • 1
    No, you can find it out at runtime calling UIScreen.main.scale (or something along those lines), but you shouldn’t need to care :) The App Store delivers only those images to a device which it needs (so every retina device will only get the `@2x` images, every plus-sized iPhone only gets the `@3x` images and old non-retina devices get the `@1x` images. Edit: I just re-read you questions, sorry, yes in this case you should care :) ) – HAS Jun 23 '17 at 20:59

2 Answers2

24

@3x:

  • iPhone 11 Pro, Pro Max
  • iPhone Xs, Xs Max
  • iPhone X
  • iPhone 8 Plus
  • iPhone 7 Plus
  • iPhone 7 Plus
  • iPhone 6s Plus
  • iPhone 6 Plus

All other devices are @2x. (including the iPhone 11 and XR)

Link to apple developer docs (New iPhones are still missing in the official documentation)

Şafak Gezer
  • 3,928
  • 3
  • 47
  • 49
facumenzella
  • 559
  • 3
  • 10
  • Yes I read this as well, but on some websites I see that some iPads use @ 3x, so I am confused. – John Jun 23 '17 at 21:05
  • 3
    And all iPads running iOS applications not designed for iPad use @1x, no matter what the device resolution. – gnasher729 Jun 23 '17 at 21:25
  • @gnasher729 I'm opening my iPhone app in iPad, which according to you should pick 1x asset, but it's not picking 1x, it's still picking 2x. I have made my 1x a smaller image but it's not picking it :( Any idea? – Hyder Aug 07 '17 at 06:30
  • ipad pro is 3x I believe – Shiva May 11 '18 at 09:52
  • Here's the updated link https://developer.apple.com/library/content/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/Displays/Displays.html – facumenzella May 12 '18 at 16:08
  • [Relevant and useful visual resource](https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions) – shim Aug 23 '18 at 18:28
  • @Shiva According to documentation, iPad uses 2x. – ABCD Oct 01 '18 at 12:39
2

Now there are different iPhone that uses @3x resolution images:

  • iPhone X
  • iPhone Xs
  • iPhone Xs Max
  • iPhone 8 Plus
  • iPhone 7 Plus
  • iPhone 6s Plus
  • iPhone 6 Plus

All other iPhone later iPhone 4s are uses @2x images.

wm.p1us
  • 2,019
  • 2
  • 27
  • 38