New apps must support iPhone X by April 2018

This code is even better and does not change with device orientation

[code]declare function mainScreen lib UIKitLib selector “mainScreen” (clsRef as ptr) as ptr
#if Target32Bit
declare function bounds lib UIKitLib selector “nativeBounds” (obj_id as Ptr) as CGRect32
#Elseif Target64Bit
declare function bounds lib UIKitLib selector “nativeBounds” (obj_id as Ptr) as CGRect64
#Endif

#if Target32Bit
dim sz as CGSize32 = nativeBounds(mainScreen(NSClassFromString(“UIScreen”))).rsize
#Elseif Target64Bit
dim sz as CGSize64 = nativeBounds(mainScreen(NSClassFromString(“UIScreen”))).rsize

#Endif

Dim w, h As Integer
w = sz.w
h = sz.h

Dim screen1 as Text
screen1 = w.toText(xojo.core.locale.Raw, “#”) + “x” + h.toText(xojo.core.locale.raw, “#”)
[/code]

screen1 should be 1125x2436 on iPhone X

Thanks a lot Jeremie for your work ;-))

Is 2017r3 (the current version) abke to generate this kind of application ?

No.

I have also got the same mail regardin g the What is Apple’s Incorporated date. Besides that , I want to know the current version of it also, there is a lot of complexity I have with my iPhone. Even I gave some support from Avast Support but is was not totally clear to me, suggest me an actual answer of that.

just wondering… is Xojo (or any of the supplied declares) taking into account the SAFEAREA required for iPhoneX?
All iPhones actually have a “SAFEAREA”, but most of them define it the same as screen size (minus 21px for statusbar in Portrait mode)… but for iPhoneX there are insets required, and areas of the physical screen you should not put controls
and Apple may (probably will) reject any app that violates that area.

so while in Portrait Mode an iPhoneX is [0,0,375,812] then SafeArea is [0,44,375,734] (points)
and LandScape would be [0,0,812,375] with SafeArea of [44,0,724,354]
margins for Port vs Landscape are vastly different

If you use autolayout then the safe area is automatically taken care of.

oh yeah… forgot, but there is no IF, as Xojo doesn’t offer you that choice