Hacker News new | ask | show | jobs
by interpol_p 307 days ago
Safe area can account for things that are not just a notch. It's used across Apple platforms to indicate anything that might need to occupy a dedicated region on the screen: notch on iPhones, home indicator, iPadOS traffic light buttons, menu bar, curved edges of displays, and so on

Your container views can extend the safe areas for their children as well. In our apps, which allow users to run their own custom projects, we increase the safe area for our UI so that users can avoid it in their own rendering

Safe area is a fairly neat and functional API. The unfortunate thing is the older `CGDisplayCopyAllDisplayModes` API is just lumping all resolutions together

1 comments

Even then, you can still have something descriptive like unobstructed_area for more general cases. "Safety" is too generic

But also you don't need to degrade Mac dev experience for games to tackle ipads the games will not be developed on, aliases exist

How is unobstructed area, a term you just made up, better than safe area, a term that has been standard for decades?
That's obvious: the descriptive term is obvious in what it represents on your screen, so has a low cognitive overload for all the new generations of people learning these APIs. Encoding bad practices for decades, on the other hand, just reflects the pains of the old generations.