iPhone X safeAreaInsets, more accurate for notch and corners for improved fidelity

The safeAreaInsets are good way to ensure buttons can be pressed. But the region is way too large to accurately determine the visible screen area.

I wonder if it is possible or what other developers think about a more accurate way to determine occluded pixels.


If we know the exact pixels occluded, we can spread out visual important information more accurately.

Right now, the safe area is huge, just ensuring buttons can be pressed. But it does not help to use the full potential of the new screen.


I would like to propose a very accurate enumeration of shapes.

It is optional, and programmers can devide if they want to use it or not. The shapes can be used to calculate or decide how to support the full visual fidelity of the new iPhone X and any upcoming devices.


If there is no such way and people start hacking around it, many new potential devices will break the hacks since the cutouts could be different.


Pierre.

Replies

>> many new potential devices will break the hacks


I think there's a big danger that code based on accurate geometry will break on new devices, too.


Can you give a convincing example of a use case for the sort of information you're asking for? Tucking controls into the "ears" at the top of the screen doesn't seem like a great idea, and forcing controls hard into the corners doesn't seem necessary either.

It be much easier to explain with an image, but I can not attach anything here.


Please use this page as reference:

https://developer.apple.com/ios/human-interface-guidelines/overview/iphone-x/

Section Layout, last topic "Provide a full-screen experience" which shows the iPhone X with the safe area in blue.

Look at the landscape orientation. The complete region left and right of the safe area is sufficient in size to place information.

Especially the side opposite of the notch (camera) is a large area.


I am mostly working on games or apps with Open GL and all elements are custom drawn and do not use the native UI.

As is the cast with most of those types of apps.

Currently the API only provides us with this safe area.


Lets say I like to place a coin or score text on the screen, out of the way so it does not interfere with the playing area, yet it must be visible.

Before iPhone X and the safe area might align the text to the top left position, 0,0 in pixel coordinate.

But taking into account potential regions which might be obscured, I am using the safe area. Hence it would be moved much further to the right since the safe area is extended further than what I would need in my case.


The same is true for all other kinds of information, I can only rely on the safe area and cannot play anything which is important outside out it since it could potentially be hidden.


If we had knowledge of the actual regions which are covered, we can use the space much more efficiently.

Also it allows to come up with much more creative and artistic ways otherwise not possible.


I have already seen apps which place their own icons next to the home indicator.

Many will follow and will most likely adopt to the corners and the notch.

As soon as a new iOS device will be released with a chance in any of those specs, the apps will break, and it will look bad.


So, I propose to prevent all this by providing sufficient information.

And while I am at it, someone please a way to retrieve the actual physical screen size in inches or centimeters.

Here is the weak point in your argument:


>>I have already seen apps which place their own icons next to the home indicator.

>>Many will follow and will most likely adopt to the corners and the notch.


If others are doing things which violate safety guidelines, they are by definition doing something unsafe, and following them is the wrong thing to do. It's just not a valid justification. It isn't even going to take a new device to break their assumptions. Any non-trivial change to the way the reserved space is used (such as a revision of how the home indicator looks or works) is liable to break their apps in some way.


Apple doesn't say this explicitly, but their recommendations make it clear that they had a choice (especially in landscape mode) to use space maximally, or to use space symmetrically. Clearly, they chose a symmetric solution. While you (especially if you're making games, where space can be at a premium) might wish they'd made the other choice, I think you need to be very, very careful before you try to force the opposite choice for your apps.


Sticking with the game scenario, where consistency with unrelated apps is much less important than non-game scenarios, I would say that if your need to use the space "wasted" by the safe areas is too great to ignore, you already have a solution. You know the sizes and usability geometry of all existing devices your game is intended to run on. You know where the notch is on an iPhoneX, and to the extent which you care about the effects of the corner rounding, you know how big the curves are. You therefore have enough information to customize your layout for every device and orientation, if you wish.


The only other thing you need to do is restrict your layout to the safe area on every device/orientation that you don't choose to customize, which will automatically keep to the safe area on future devices (until you have a chance to add customizations).


However, I don't want to discourage you from pursuing this if you think it's important enough. I would suggest you come up with a more specific proposal of the information that you would need. (A mask of available pixels, for example, wouldn't be much help, nor would a Bezier path of the screen boundary. The heuristic for determining usable sub-areas would be impossible, in the face of arbitrary geometry. Perhaps you could ask for a maximal layout rectangle, plus a minimal edge margin, both orientation-specific.) Your best chance of convincing Apple is to submit a bug report with a compelling and specific use-case.