New apps must support iPhone X by April 2018

https://arstechnica.com/gadgets/2018/02/apple-dictates-that-all-new-apps-must-fully-support-the-iphone-x-screen/

Strange that this claim doesn’t appear on Apple’s developer newsfeed.

https://developer.apple.com/news/

I wonder if that was somebody’s idea of an April Fools joke (since it supposedly goes into effect April 1st).

Seems legit, I got the email, here’s a screenshot, the link goes here https://developer.apple.com/ios/submit/

What is Apple’s Incorporated date ?

I got same email and same Incorporated date.

[quote=374301:@JulianS]Seems legit, I got the email, here’s a screenshot, the link goes here Submit your iOS and iPadOS apps to the App Store - Apple Developer
[/quote]

Second paragraph on the page:

Yesterday I used the WWDC app on my iPad to watch a couple of videos on iPhone X that were added since WWDC. Basically, it sounds like TopLayoutGuide and BottomLayoutGuide are deprecated and will be replaced by SafeArea with backward compatibility. So if you want to be iPhone X compliant, you might have to revisit the constraints on every control in your app and change things. A much larger job than when Xojo changed how tables work. If this is the case, then I’m hoping for some kind of automagic conversion option.

I have to release a new App for a customer lately in April, so what to do?
I would appreciate to get an official statement from Xojo regarding this.

[quote=375291:@Hans-Jürgen Müller]I have to release a new App for a customer lately in April, so what to do?
I would appreciate to get an official statement from Xojo regarding this.[/quote]
I don’t know if this works, it’s just an idea.
Try uploading the app before Apri(unfinished)l, but don’t publish it. That way it’s technically not a NEW app so the requirement might not apply? :slight_smile:
Later when the app is done, upload a new version and publish.

[quote=375291:@Hans-Jürgen Müller]I have to release a new App for a customer lately in April, so what to do?
I would appreciate to get an official statement from Xojo regarding this.[/quote]

Since you’re a pre-release tester, I think that you should download 2018r1 and give it a try :slight_smile: It should work fine.

Thanks for your advices (Albin, Jason), i will try both ;-))

Hi Jason, Beta 2018r1 works with Xcode 9 and i’ve had no problems so far.
The only thing i didn’t found out is how to detect if an iPhoneX is used, because i have to change the layout of my views depending on the device.

Thanks in advance for your help

Did you try getting the screen size to check if it is iPhone X?

Thank’s Jeremie, i will give this a try.

This should help.

Dim MainScreenScale as Double

  //declare function NSClassFromString lib "Foundation.Framework" (aClassName as CFStringRef) as Ptr
  declare function NSClassFromString lib "Foundation" (aClassName as CFStringRef) as Ptr
  soft declare function scale lib "UIKit" selector "scale" (classRef as Ptr) as CGFloat
  soft declare function mainScreen lib "UIKit" selector "mainScreen" (classRef as Ptr) as ptr
  
  MainScreenScale = scale(mainScreen(NSClassFromString("UIScreen")))
  

declare function mainScreen lib UIKitLib selector "mainScreen" (clsRef as ptr) as ptr
  #if Target32Bit
    declare function bounds lib UIKitLib selector "bounds" (obj_id as Ptr) as CGRect32
  #Elseif Target64Bit
    declare function bounds lib UIKitLib selector "bounds" (obj_id as Ptr) as CGRect64
  #Endif
  
  #if Target32Bit
    dim sz as CGSize32 = bounds(mainScreen(NSClassFromString("UIScreen"))).rsize
  #Elseif Target64Bit
    dim sz as CGSize64 = bounds(mainScreen(NSClassFromString("UIScreen"))).rsize
    
  #Endif
  
  Dim w, h As Integer
  w = sz.w * MainScreenScale
  h = sz.h * MainScreenScale
  
Dim screen1 as Text
  screen1 = w.toText(xojo.core.locale.Raw, "#") + "x" + h.toText(xojo.core.locale.raw, "#")

screen1 should be 1125x2001 on iPhone X

It was my understanding that those declares returns PIXELS not points
and that for iPhoneX is would return 375x812 (at least thats what iOS returns)

You are almost right Dave.

mainscreen.bounds returns the size of the screen in points. https://developer.apple.com/documentation/uikit/uiscreen/1617838-bounds?language=objc

In my code, that size is then multiplied by the screen scale to get the result in pixels.

perhaps its too early… but aren’t points the smaller element?

for example @2x is 1 pixel = 4 points (2x2)

and an iPhoneX screen is 1125x2436 points or 375x812 pixels @3x
which by the way are the answers that iOS provides

No actually pixels are the smaller physical element.

1 point @2x is 2x2 pixels

https://www.paintcodeapp.com/news/iphone-x-screen-demystified
https://www.paintcodeapp.com/news/ultimate-guide-to-iphone-resolutions