With the iPhone’s ‘notch’ now present on their 3 new phones, as well as last year’s iPhone X, detection of the ‘notch’ is necessary.
Prior to these new phone announcements, I set a new variable notchFlag=1 if either of these two conditions exist. But instead, we need code that will compare the safeArea properly so that notchFlag can be set to account for any current or future iPhone notch. Can someone familiar with the safeArea parameter who has a real iPhoneX help with this?
- if system.getInfo(“environment”)==“simulator” and display.viewableContentWidth=1125 and display.viewableContentHeight=2436 then --this only accounts for current iPhoneX simulator model
and
- if system.getInfo(“platform”)==“ios” then
local archInfo=system.getInfo(“architectureInfo”)
if (string.find(archInfo,“iPhone10,3”,1,true) or string.find(archInfo,“iPhone10,6”,1,true) then
--this works for iPhoneX, but what about XS and XR?