iphone-x
How to correct Tab Bar height issue on iPhone X
On iOS 12.1 I’ve solved this issue by overriding safeAreaInsets in the UITabBar subclass: class TabBar: UITabBar { private var cachedSafeAreaInsets = UIEdgeInsets.zero override var safeAreaInsets: UIEdgeInsets { let insets = super.safeAreaInsets if insets.bottom < bounds.height { cachedSafeAreaInsets = insets } return cachedSafeAreaInsets } } For iOS 13.0 onward, class TabBar: UITabBar { private var … Read more
What is the ‘safe region’ for iPhone X (in pixels) that factors the top notch and bottom bar?
In Portrait Top: 44pt Bottom: 34pt Left/Right: 0pt In Landscape Top: 0pt Bottom: 21pt Left/Right: 44pt
UICollectionView in landscape on iPhone X
Having the same issue. This worked for me: override func viewDidLoad() { if #available(iOS 11.0, *) { collectionView?.contentInsetAdjustmentBehavior = .always } } The documentation for the .always enum case says: Always include the safe area insets in the content adjustment. This solution works correctly also in the case the phone is rotated.
iPhoneX and iPhone 8 keyboard height are different
While Craig’s answer is correct, you might not want to pin your view to view.bottom or the bottomLayoutGuide rather than the safe area bottom (especially if your keyboard is not always open, and you don’t want your views to cover the Home Indicator area). Here is a fix for these cases. It deducts the height … Read more
Getting a white space at bottom of iPhone X screen (Xcode 9)
Your bottom constraints should be from view not from the bottom layout guide or safe area(xcode 9 specific) and your distance should be zero. Default it was pinned with layout guides, so give it with view ! Refer below screenshot for better understanding, to open this dialogue, click drop down icon of field contains 0! … Read more
How to fix Xcode error: Could not locate device support files on iPhone with Xcode
Answer: Xcode: Could not locate device support files Well, I found non of the answers logged out here aren’t complete and sustainable. So here we go. Most importantly don’t waste your time and internet bandwidth downloading Xcode just to resolve this issue which you can do within few MBs and little bit of OS know-how!!! … Read more
Extra bottom space/padding on iPhone X?
In iOS 11, views have a safeAreaInsets property. If you get the bottom property of these insets you can get the height of the bottom padding while on iPhone X: if #available(iOS 11.0, *) { let bottomPadding = view.safeAreaInsets.bottom // … } (likewise for the top padding with status bar)
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