r/iOSProgramming • • 21h ago

Article Development Lessons: App for Duo

A lot of newer indie and solo developers, including vibecoders, probably want an app that works on the Duo but, due to cost, may not have one. So here are some lessons from developing ahead of the Duo launch, with no device in hand.

We started development of Millpond which is a side-project of a more intentionally health-domain app that we have currently in-development. There were some features and approaches that we could do in a water tracker that I wouldn't want to test in a more health-data/sensitive app.

So in late Summer, about 6 weeks before the iPhone Duo shipped we forked and dedicated some time to it. Given it was going to be cross-platform it is largely a common Expo core, with native elements for Apple services, widgets, watch and notifications. We had 2 app revisions prior to launch, 1 to check branding on Apple services (Location, Health) and 1 because Duo screenshots had black bars to fill the size due to errors in the beta version of xCode for Duo - but that was at build 340 and with several non-dev test flight users.

One of the reviews took over a week just pre-launch of Duo. And ended up withdrawing that ourselves and resubmitted and got through 2 days later. We missed the Duo launch due to the delay, but went live shortly afterwards.

Summary: We logged 19 layout mistakes by folding and unfolding the simulator. The worst: the main screen collapsed to zero height because of a single number. The code looked fine, which is why it took a while to find. AI coding tools often don't flag that kind of bug for the same reason.

The device

The folded outer display is 466 x 678 pt. Unfolded, the inner display is 951 x 669 landscape: about (but not exactly!) twice the width at the same height. Your app has to survive the switch mid-session, with the user watching.

Our lessons: what you'll see, and what to do (or tell your coding agent to do)

You'll seeBecausePaste this
The main screen is squashed or empty on the folded displayThe tab bar became a side pill, and its height now reads as the whole screen (678 pt). Your bottom padding is a screen tall"Never use the tab bar's height as padding."
A grid stays one column after folding backPercentage widths go stale on resize"No percentage widths on anything that resizes. Use fixed point values."
Sheets open full-height with most of it blankThey were sized for a tall phone. We had 508 pt of nothing"Sheets must fit their content on a 466 x 678 window."
Buttons are hard to hitThe tap area stuck out past the parent, and iOS ignores it there"Every tap target is at least 44 pt tall."
Cancel draws under the status barSafeAreaView inside a Modal reports zero insets"Read safe-area insets outside the Modal and pass them in."
The app runs in a box with bars around itIt was built with an old SDK"Build with the iOS 27.1 SDK or later."

Also tell it to size layouts from the current window size, never the phone model or orientation.

It's not just a wider screen

Stretching everything is the easy plan. We skipped it, because the second screen is a different job. Apple's rule is the same state and the same functions on both displays, with the inner one allowed to add one level of hierarchy. Same app, one more layer.

Then we asked who's holding it:

How it's heldWhat the person wantsWhat we did
Outer display turned sideways, in hand or a mountGlance, log a drink, leaveDisplay on top, tap targets in one row below
Same window, standing as a tent on a deskRead it from about 1 m for hours. A tap near the top tips it overSoftware can't tell this from the row above, so we designed for the harder one: the top half is look-only, with one number readable from across the desk
Unfolded, or half open in an LWatch the top, touch the bottomContent above the crease, controls below, so folding to the L moves nothing

We also drew an ambient tent mode (chrome fades after 20 s of stillness). It's behind a flag, off.

What that looked like per screen:

  • Pacing (Home). Collapsed behind a toggle on a compact window, open by default with room.

  • Drink buttons. Where they sit is a per-display setting, and only a folding phone sees both.

  • Logbook. Unfolded, it's one full-width list. Open an entry and the window splits at the hinge, list left and editor right. Close it and the list goes back to full width. We tried an always-on split and rejected it.

  • Insights. Folded, the pond hero is the top of the scrolling list. Unfolded, it gets its own pane on the left and the history scrolls on the right.

  • Settings. One column folded, two unfolded. Our first split was by card role, and the right column gave up halfway down, leaving about half the width empty. Now cards are placed by measured height, with Subscription pinned top-right.

All of it keys off window size: three layouts, no pose detection. The poses only decided what each layout is for.

The native tab bar is great for the Duo, and only the Duo

We used the native tab bar, with an icon on every tab. On the Duo the system moves it to a side pill on the outer display and in inner landscape. No code. Enjoy it while it lasts.

Then a regular iPhone went landscape. It keeps its bottom bar, and there isn't enough height left for a bar plus your content. Landscape on a regular iPhone is work you do yourself, if you want it at all.

First, we locked non-fold phones to portrait. We wanted to launch fast for the Duo, so a folding phone can rotate and others can't. Millpond is still in this state and probably will stay that way, because the use case is quick logging.

For user testing we built a custom rail anyway. When the window is wider than tall, we hide the native bar and draw our own where the Duo's pill sits. The Duo's shortest landscape window is 466 pt tall, so 450 pt is our cutoff. The rail sits behind the portrait lock, ready if we ever want it. We've only checked it on one simulator, in one landscape direction.

The trigger is window size, not model, so it should hold up on future phones.

Don't skip the regular iPhone

Building Duo-first makes it easy to forget the phone most of your users hold. Every visible change now gets a pass on a regular iPhone in portrait (about 400 pt wide, one column) as well as the Duo.

A turned regular iPhone and the turned Duo outer display land in the same short, wide layout. Design it once, and check it at large text.

The test that finds most of it

You don't need hardware to fold the phone. Xcode's simulator has fold and rotate buttons in its toolbar, with folded, half-open and unfolded states. There's no command-line switch, so a human presses them.

Fold, unfold and fold again, with a screenshot at each step (your tool can take those). The last screenshot should match the first. If it doesn't, you've found a bug. We ran a full audit before fixing anything: 42 screenshots, a scored critique, then 12 high-priority fixes in a day.

What the simulator can't do: drive Split View, or register automated taps on the side tab pill. Keep a list of what you haven't seen on hardware. Ours is longer than we'd like.

The app is Millpond Water Tracker, a small hydration tracker.

10 Upvotes

14 comments sorted by

11

u/LKAndrew 20h ago

This is all pretty bad advice. You shouldn’t be measuring window sizes at all, you should be building responsive design and layout. Window sizes should be dynamic because your app can be completely resized to any size now, the Duo is not just inner and outer screens. There are many multitasking modes.

2

u/MyAugur 20h ago

Windows sizes are dynamic, because agree it is building responsive design and layout. The question is responsive to what? Given the port to Android means more screensizes to accomodate across different platforms being responsive to the window size the the app flexes the UI dynamically around a bunch of patterns.

2

u/LKAndrew 20h ago

The tools given to you have no need for window sizing.
There’s never really a need to measure anything.
You use layout tools and APIs to lay things out responsively without taking measurements for the most part unless you need to do something peculiar

2

u/MyAugur 20h ago

Right for SwiftUI / UIKit - size classes, ViewThatFits, Auto Layout are all good if you can access them. Appreciate this is commentary on the iOS Programming sub, so you are right for most developers here.

The main project uses React Native and is why Millpond uses it too, and RN doesn't have an equivalent, so you have to read the dimensions yourself. For how it is then displayed, Flexbox handles the flow but can't choose between a single column and two panes, or between a bottom bar and a side rail which needs a width, and useWindowDimensions is the API for it. So maybe its just using the tools available - and of course I only know what I know, so there is likely approaches or features in RN I could have used better.

7

u/distractedjas 20h ago

The iPhone Duo is such a small market share that my company decided not to do any special work for it for the time being. There are so many other things that will provide a larger impact. I’ve more or less done the same for my side projects. Any special effort for the duo is purely performative for the short term at least.

1

u/MyAugur 19h ago

Fair. Bigger in the Android world - though with existing apps on iOS only I can understand why Duo wouldn't be a priority for now. You did call it on my approach, the timing of development meant I was trying for the polish/performative and learning on foldables.

3

u/HelpRespawnedAsDee 18h ago

I decided to move forward anyways. Management ended up really liking it. I honestly feel it’s a bad look to keep the letterbox look. The Duo will only grow in popularity.

1

u/distractedjas 14h ago

Yeah, we fixed the letterbox, but that’s it.

2

u/ThalesMother9938 11h ago

The fold, unfold, fold again test with the last screenshot matching the first is a really simple check, I'm stealing that one. One thing that caught me on the Duo: the inner display ignores orientation lock, so a user who locked portrait still gets the wide layout when they open it. Did that show up in your 42 screenshots , or did the simulator hide it?

1

u/MyAugur 2h ago

Good point - sim doesn't have an orientation lock. Our code leaves folding phone orientation unlocked so isn't something I'd picked up.

A couple other things:
- The sim switches poses in one step. Hardware animates the transition, so i did look at this. Particularly because of the way the initial pond design rendered.
- There's no way to test battery until on a real device, so sim could test the sustained cost on the larger inner display and particularly for a dynamic scene like Millpond's Water Tracking home screen. Mainly from the water shader for the - which meant when we added SKIA for more accurate reflections on the surface, I ended up putting a quality/fallback option and also putting in a timer, so the motion stops after a certain period.

- Also, the sim only has two poses. Real multitasking gives any width, so we had to make sure we were reading the state correctly. And why another commenters' use of API for fold/orentation state might have been helpful, but as app uses RN, we read from useWindowDimensions which is as good as it gets.

1

u/busybags 21h ago

Hopefully people get a device before releasing for it! No need for more slop in the store.

Appreciate the write-up.
Also - your last picture looks super distorted.

2

u/MyAugur 20h ago

Apps don't pay like they used to and not everyone can drop $2k on a phone off the bat, so at least have it designed for Duo rather than the default stretched screen view that sucks. Evidenced by the stretched inline image that reddit put in and looks terrible here too!

1

u/Oikon__ 10h ago

Claude and Devin have internal simulator but I think developing Duo App is still low priority…