Apple iPhone Duo makes developers think in folds
Cupertino's $2,000 foldable gives devs more screen, and more UI state to manage
devops
Apple iPhone Duo makes developers think in folds
Cupertino's $2,000 foldable gives devs more screen, and more UI state to manage
The October 23 ship date of Apple’s iPhone Duo grows nigh, so developers wanting to optimize their iPhone apps for the foldable will need to get to grips with its new display behaviors and form factor.
“A fold is a UI event with backend consequences,” Atharva Deosthale, Appwrite developer advocate, wrote in an introductory blog post. “Folding and unfolding is part of normal device use, so apps need to preserve state and respond cleanly when the display changes.”
The iPhone Duo, which Apple introduced last week, is a smartphone with two screens: a squat 5.4-inch (diagonal) outer display on top of the case and the larger 7.6-inch inner display within. The display’s contents automatically (and stylishly) move to the visible screen when the device is opened or snapped shut.
Apple has published a repository of technical documentation to help devs prepare for the new form factor. Time to study up.
An ever-shifting canvas
The foldable fondleslab will run iOS 27.1, and will run unaltered iPhone apps, but in the same way regular iPhone apps run on the iPad: awkwardly.
Devs need to learn some new moves to style their apps to truly make Apple’s mobile device look good.
The foldable form factor means that the user may start work on an app on the top screen, and when the device opens, the app should appear seamlessly on the larger display (the display ratio remains the same across both screens).
The phone doesn’t have to lie flat for the inner screen to be fully used; it can also fold into a “tabletop posture,” where half the screen is flat and the other half sits upright, like a little laptop.
Or it could be fashioned into a partially opened “book posture,” with the fold running vertically. Maybe for privacy? Who knows what other ways people, with their endless ingenuity, will interact with these gadgets.
Both screens have a 120 Hz adaptive refresh rate, thanks to Apple’s ProMotion technology. So any transitions within the app, and resizing of the app itself, need to be almost Walt Disney animation-level smooth - while maintaining state.
The device can accommodate two apps simultaneously running on the screen, through “Split View,” so apps will also have to learn to share the screen nicely.
To address this new topology, Apple is updating its Xcode IDE; the 27.1 beta will be available later this month.
The backend will need some love too
The iPhone Duo screen is a different world for a number of reasons. Size is no longer a value, but a dynamic range, Deosthale noted. An app’s available size needs to be read at layout time and adjusted through the app’s lifetime as its screen allocation changes.
Some apps will work better in this environment than others, Deosthale noted. Apps with fixed layouts and hardcoded dimensions, or that use view controllers that reload on size change, can appear stretchy. “Those need work,” he wrote.
Compared with the iPhone Pro Max, the Duo offers a bit more space, with a 7.6-inch inner display versus 6.9 inches. It’s wide enough that a single column stretching across the entire display won’t impress anyone. Now’s the chance to add in a detail pane or sidebar, side-by-side presenter and viewer modes, Deosthale suggested.
And don’t let the app just disappear features, data or other miscellanea when the user switches screens. That will just come off as cheesy. Snapping the unit shut mid-task means the app needs to preserve its state, along with the user’s session identity, as the interface moves to the outer display.
Try not to move components around too much when the display switches, leaving the user seeking some option anew. In the technical docs, Apple calls this keeping a “consistent experience.”
Contrary to the traditional iPhone layout, some of the device’s system controls have moved from the bottom toward the side of the display, which, in landscape mode, is a sensible change that leaves more, albeit asymmetrical, vertical space. However, it is up to developers to ensure their apps aren’t covered by system controls.
While this may not directly relate to the form factor itself, the device runs an A20 Pro system-on-a-chip, built at 2-nanometer scale, with a 6-core CPU, a 7-core GPU wired for matrix math, and a dual 16-core neural engine for ML work. All this horsepower means you can run local ML inference on the device itself.
Perhaps add a button to destroy humanity? It’d be the perfect antidote for a rough day at work.
If Apple developers have any questions about working with foldable displays, they can ask their Android brethren who have been wrangling foldables for almost a decade now.®
Originally published on The Register
