The UINavigationBar in my iOS app has a custom height, which causes issues on the iPhone X.
Exists a reliable way to programmatically determine whether an app is running on an iPhone X (in Objective-C)?
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
CGSize screenSize = [[UIScreen mainScreen] bounds].size;
if (screenSize.height == 812)
NSLog(@"iPhone X");
}
The real query is: "Can I determine whether the current device is an iPhone X directly, such as through an SDK feature, or do I need to use indirect measurements?"