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
In Portrait Top: 44pt Bottom: 34pt Left/Right: 0pt In Landscape Top: 0pt Bottom: 21pt Left/Right: 44pt
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.
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
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
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
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)
You should override prefersHomeIndicatorAutoHidden in your view controller to achieve that: override var prefersHomeIndicatorAutoHidden: Bool { return true }
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
The display on iPhone X, however, is 145pt taller than a 4.7″ display, resulting in roughly 20% additional vertical space for content. for more information you get HIG for iphone X from apple documents and detail description in here1 and here2 status bar height previously 20pt, now 44pt Because of the sensors on top of … Read more
There are some issues with safe area layout and backwards compatibility. See my comment over here. You might be able to work around the issues with additional constraints like a 1000 priority >= 20.0 to superview.top and a 750 priority == safearea.top. If you always show a status bar, that should fix things. A better … Read more