How to Add iPhoneX Launch Image

If your used the LaunchImage.launchimage for Launch, the solution is (in Xcdoe 9.0): Select Assets.xcassets, right click on middle pane, select App Icons & launch Images -> New iOS Launch Image . Then move the old LaunchImage.launchimage images to the new one, and add the image size with 1125×2436 px for the iPhoneX. Also, you … Read more

Can we test Face ID in simulator?

Simulator does not recognise a face but allows you to simulate a matching and non-matching faces, if you’ve enabled Enrolled option from Face ID. Add following code to your view controller and try with Face-ID import LocalAuthentication class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() localAuthentication() } func localAuthentication() -> Void { let laContext … Read more

iPhone X / 8 / 8 Plus CSS media queries

iPhone X @media only screen and (device-width : 375px) and (device-height : 812px) and (-webkit-device-pixel-ratio : 3) { } iPhone 8 @media only screen and (device-width : 375px) and (device-height : 667px) and (-webkit-device-pixel-ratio : 2) { } iPhone 8 Plus @media only screen and (device-width : 414px) and (device-height : 736px) and (-webkit-device-pixel-ratio : … Read more

iOS 11 iPhone X simulator UITabBar icons and titles being rendered on top covering eachother

I was able to get around the problem by simply calling invalidateIntrinsicContentSize on the UITabBar in viewDidLayoutSubviews. -(void)viewDidLayoutSubviews { [super viewDidLayoutSubviews]; [self.tabBar invalidateIntrinsicContentSize]; } Note: The bottom of the tab bar will need to be contained to the bottom of the main view, rather than the safe area, and the tab bar should have no … Read more

Get safe area inset top and bottom heights

Try this : In Objective C if (@available(iOS 11.0, *)) { UIWindow *window = UIApplication.sharedApplication.windows.firstObject; CGFloat topPadding = window.safeAreaInsets.top; CGFloat bottomPadding = window.safeAreaInsets.bottom; } In Swift if #available(iOS 11.0, *) { let window = UIApplication.shared.keyWindow let topPadding = window?.safeAreaInsets.top let bottomPadding = window?.safeAreaInsets.bottom } In Swift – iOS 13.0 and above // Use the first … Read more

Cordova app not displaying correctly on iPhone X (Simulator)

I found the solution to the white bars here: Set viewport-fit=cover on the viewport <meta> tag, i.e.: <meta name=”viewport” content=”initial-scale=1, width=device-width, height=device-height, viewport-fit=cover”> The white bars in UIWebView then disappear: The solution to remove the black areas (provided by @dpogue in a comment below) is to use LaunchStoryboard images with cordova-plugin-splashscreen to replace the legacy … Read more