1

I've seen many questions similar to mine and a lot are a bit vague, but I think I've found the answer to my question, I just need to know how it translates to Swift. This is what I understand about the asset catalogue:

@1x -          standard iPhone (3G, 3GS
@2x -          iPhone 4, 4s and iPhone 6
Retina4@2x -   iPhone 5,5s
@3x -          iPhone 6

The problem that I have seen many questions about is that there is a bug in Xcode that means that when rendered, the iPhone 6 doesn't zoom to fit, so you either have to have images that fit the 6 but are too big for the 4s, or fit the 4s and look too small in the 6 because they don't render as they should. Seems there are 2 solutions, either change the way the images are rendered (see the link below) or don't support the 4s. The answer in the link below provides a way to support the 4s by changing the way the images are loaded. What I want to know is how this is translated into swift, or if 9 months on there is a better solution. If neither of these are any good, how to I go about not supporting the 4s in my app as it can still update to the latest iOS software.

xcode 6 asset catalog iphone 6 - link to the answer I need in Swift if possible

I hope this makes sense, I've been pulling my hair out trying to work this out. Thanks in advance.

Community
  • 1
  • 1
JGrn84
  • 750
  • 1
  • 9
  • 26
  • You list is incorrect, `@1X` is for the iPhone, 3G and 3GS. The `@2x` is for iPhone 4, 4S, 5, 5S, 5C and 6. The `@3X` is for iPhone 6+ – rckoenes Jul 28 '15 at 14:33
  • Advice: Learn Objective-C. This makes you life as an iOS developer so much easier. – dasdom Jul 28 '15 at 14:37
  • What are you trying to do? Icons or show an image? Should the image file parts of the screen or the whole screen etc? 1x, 2x, 3x has to do with the DPI of the screen, not the size or aspect ration. In addition to what rckoenes says, 1x is for iPad 1,2 and the first mini and 2x for other iPads. – Stefan Jul 28 '15 at 14:41
  • I was under the impression that 2x was for iPhone 4, 4S, 5, 5S, 5C and 6 unless you make the asset library device specific and add Retina 4, which is used for iPhone 5, 5S and 5C. Also, I am trying to load an image using a sprite node with image named. When loading the image on the iPhones 4s, 5, 5S, 5C and 6 plus they fit nicely, only iPhone 6 has the problem as it is using the @2x image asset which is sized up for the 4S. So I either have a small image on 6 or an image too big on the 4s. – JGrn84 Jul 28 '15 at 14:52
  • Maybe you can find the answer here: http://stackoverflow.com/questions/25205882/dealing-with-different-ios-device-resolutions-in-spritekit – Stefan Jul 28 '15 at 15:40

0 Answers0