Sitemap
Level Up Coding

Coding tutorials and news. The developer homepage gitconnected.com && skilled.dev && levelup.dev

Member-only story

Size Classes Are Not Enough

--

SceneGeometry, the iPhone Duo, and the numbers SwiftUI doesn’t hand you…

Press enter or click to view image in full size
Screen Capture 2026, Michael Long

There’s a school of thought in SwiftUI land that says adaptive layout is a solved problem.

Read horizontalSizeClass, branch on .compact or .regular, and you can clock out and go home early. Apple gave you those two cases for a reason, the argument goes, and anything more elaborate is just fighting the framework.

And that was generally true when every iPhone was a phone and every iPad was an iPad.

But Apple’s new iPhone Duo doesn’t play by those rules, and the moment you try to build a layout that survives them, two little measily size classes stop being enough.

Let’s take a look.

Size Classes

Here’s what a size class knows: Regular. Compact.

One of two words, per axis.

So here’s what you don’t know: how much room you actually have, where the safe areas are, which way the device is turned, and whether or not there’s a status bar, a cutout, or a hinge sitting in the middle of your screen.

Consider an iPhone 17 Pro in portrait. Horizontal compact, vertical regular, 402 by 874 points, with 62 points safe area insets at the top and 34 at the bottom.

--

--

A Lead Software Engineer who writes about Apple, Swift, SwiftUI, and technology. Also author of the open source projects Factory and Navigator.