I have an app that I am updating since Apple made having a launch screen storyboard a must. I have created the launchscreen storyboard and included all the launch images in my images.xcassets folder.
The problem is that when the simulator loads the app in iPhone 8, 8+, iPad (7gen),iPad Air, iPad 9.7 the launch image is blank. The included images do not load. In the simulators for the iPhone 11, 11Pro, 11ProMax, iPad11, and iPad12.9 the launch images show up fine.
I know the correct phone is being loaded because I have put:
if([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){
NSLog(@"THIS IS DEVICE STRING ");
if([UIScreen mainScreen].fixedCoordinateSpace.bounds.size.height == 480.0){
// 4 320x480 x0 y0
deviceString2 = @"0";
NSLog(@"THIS IS DEVICE STRING -0");
}
else if([UIScreen mainScreen].fixedCoordinateSpace.bounds.size.height == 568.0){
//5 320x568 x0 y*1.183+62
deviceString2 = @"0";
NSLog(@"THIS IS DEVICE STRING 0");
}
else if([UIScreen mainScreen].fixedCoordinateSpace.bounds.size.height == 667.0){
//678 375x667 x*1.171, y*1.389+25
deviceString2 = @"1";
NSLog(@"THIS IS DEVICE STRING 1");
}
else if([UIScreen mainScreen].fixedCoordinateSpace.bounds.size.height == 736.0){
//678+ 414x736 x*1.29, y*1.53+28
deviceString2 = @"2";
NSLog(@"THIS IS DEVICE STRING 2");
}
else if([UIScreen mainScreen].fixedCoordinateSpace.bounds.size.height == 812.0){
//11pro&max 375x812 x*1.17, y*1.69+97
deviceString2 = @"3";
NSLog(@"THIS IS DEVICE STRING 3");
}
else if([UIScreen mainScreen].fixedCoordinateSpace.bounds.size.height == 896.0){
//11 414x896 x*1.29, y*1.867+107
deviceString2 = @"4";
NSLog(@"THIS IS DEVICE STRING 4");
}}
else if([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad){
[advertise setTitle:NSLocalizedString(@"CHESSOBJ1",nil) forState:UIControlStateNormal];
if([UIScreen mainScreen].fixedCoordinateSpace.bounds.size.height == 1024.0){
//9.7 768x1024 x*2.4 y*2.13-122
deviceString2 = @"5";
NSLog(@"THIS IS DEVICE STRING 5");
}
else if([UIScreen mainScreen].fixedCoordinateSpace.bounds.size.height == 1080.0){
//7gen 810x1080 x*2.53 y*2.256-128
deviceString2 = @"6";
NSLog(@"THIS IS DEVICE STRING 6");
}
else if([UIScreen mainScreen].fixedCoordinateSpace.bounds.size.height == 1112.0){
//10.5 834x1112 x*2.6 y*2.32-130
deviceString2 = @"7";
NSLog(@"THIS IS DEVICE STRING 7");
}
else if([UIScreen mainScreen].fixedCoordinateSpace.bounds.size.height == 1366.0){
//12.9 1024x1366 x*3.2 y*2.85-162
deviceString2 = @"8";
NSLog(@"THIS IS DEVICE STRING 8");
}
else if([UIScreen mainScreen].fixedCoordinateSpace.bounds.size.height == 1194.0){
//11 834x1194 x*2.6 y*2.49-89
deviceString2 = @"9";
NSLog(@"THIS IS DEVICE STRING 9");
} }
On the simulators the correct log is written for the device loaded, but still no images show up.
On the iPhone six the log says that the iPhone 6 is an iPhone 5 in size. (I'm not sure if the iPhone 7,8,6+,7+,8+ do the same since I am not rich enough to own all devices. I have read about this but I need to have the app recognize each iPhone so I can designate the placement and size of my various objects in the space. I cannot use storyboard auto resize as this doesn't work. The app I have connects two Apple devices together through bluetooth to play games together. When I move a piece on my device it moves on your device. So precise placement on various devices is essential.
HOW CAN I GET THE APP TO RECOGNIZE THE VARIOUS DEVICE SIZES THROUGH CODE?
I can't believe Apple would take this ability away form a developer.
Please Help!