Last September, Apple announced the iPhone XS, iPhone XS Max and iPhone XR. These three new iPhones for 2018 officially replace the iPhone X, which Apple pulled from its store after the announcement. So you should make sure that your app adapt the 3 new devices screens.
I will write small tips to refactor your code from only iPhone X support to support all the notch devices 😉 (iPhone XS, iPhone XS Max and iPhone XR)
But first what’s the difference:
Here’s a comparison between the devices screens in different ways, from PaintCodeApp
How to code it?
For me i have a func called isIPhoneX() it returns true when it’s an iPhone X screen so i can update my constraint and commit to Safe area insets.
An easy way to embrace the notch in all the app is refactor this func to find out the new iPhones also.
Renaming it to hasNotch() or whatever easy to read for you that is not only iPhone X now
Update the func body to one of the following implementation