So what I did was:
First I had the methods in the following order:
if ([UIScreen mainScreen].nativeScale > 2.1) {
//6 plus
} else if (screenBounds.size.height == 568) {
//4 inch code
} else {
//3.5 inch code
}
Then I thought since the computer stops running the if else
statement once he finds a true one I just rearranged the order to the following:
if (screenBounds.size.height == 480) {
//3.5 inch code
} else if ([UIScreen mainScreen].nativeScale > 2.1) {
//6 plus
} else if (screenBounds.size.height == 568) {
//4 inch code
}
This supported an iPhone 4S with iOS 7 or below. On iPhone 5 / 5S it would still crash. That's why I changed it in the end to the following:
if ([[UIScreen mainScreen] respondsToSelector:@selector(nativeScale)]) {
//checks if device is running on iOS 8, skips if not
NSLog(@"iOS 8 device");
if (screenBounds.size.height == 480) {
//3.5 inch code
NSLog(@"iPhone 4S detected");
} else if ([UIScreen mainScreen].nativeScale > 2.1) {
//6 plus
NSLog(@"iPhone 6 plus detected");
} else if (screenBounds.size.height == 568) {
//4 inch code
NSLog(@"iPhone 5 / 5S / 6 detected");
}
} else if (screenBounds.size.height == 480) {
//checks if device is tunning iOS 7 or below if not iOS 8
NSLog(@"iOS 7- device");
NSLog(@"iPhone 4S detected");
//3.5 inch code
} else if (screenBounds.size.height == 568) {
NSLog(@"iOS 7- device");
NSLog(@"iPhone 5 / 5S / 6 detected");
//4 inch code
}
It should now fully work on any iOS 7 an iOS 8 device!