Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 7 retina 4" assets?

Tags:

swift

xcode7

So just when I though my swift 2 upgrade could not get any worse its seems that you cannot add retina 4" 2x image assets anymore. I cannot fine any option anymore to add it, all my old assets still have the retina 4" image but I cannot create a new image set with a 4" retina image. Why?

Any ways to fix this?

like image 447
crashoverride777 Avatar asked Sep 20 '15 16:09

crashoverride777


2 Answers

Edit Contents.json of the Image Set and add

{
  "idiom" : "iphone",
  "subtype" : "retina4",
  "scale" : "2x"
}

You will see appear Retina 4 2x entry.

like image 95
Giorgio Avatar answered Sep 30 '22 11:09

Giorgio


so I asked them again what we should do if we need to scale images precisely for the 4 inch retina screen.

"What is preventing you from being able to apply the special casing code whereby you check the device type and do something different for iPhone 5, 5s, 5c?

i.e.

if ([platform isEqualToString:@"iPhone5,1"])    return @"iPhone 5 (GSM)";
if ([platform isEqualToString:@"iPhone5,2"])    return @"iPhone 5 (GSM+CDMA)";
if ([platform isEqualToString:@"iPhone5,3"])    return @"iPhone 5c (GSM)";
if ([platform isEqualToString:@"iPhone5,4"])    return @"iPhone 5c (GSM+CDMA)";
if ([platform isEqualToString:@"iPhone6,1"])    return @"iPhone 5s (GSM)";
if ([platform isEqualToString:@"iPhone6,2"])    return @"iPhone 5s (GSM+CDMA)"

Have you filed a feature request for this ability yet? (using Apple Bug Reporter) "

Not really satisfied with the answer at all because I obviously know how to check what kind device is running my app/game.

How does that help me to add a image to my asset catalogue that is only used for the retina 4 inch screen? You know like I could do before without any issues at all. It seems beyond stupid to remove retina 4 inch assets, makes no sense to me.

Also in regards to the JSON tip for Giorgio, it still seems to work actually, i think my simulator on a iPhone 5 is just messed up.

like image 41
crashoverride777 Avatar answered Sep 30 '22 12:09

crashoverride777