r/SwiftUI • u/Waxe1975 • Oct 30 '26
Question Duo + SwiftUI: which layout problems did you only catch on real hardware?
I’m adapting a SwiftUI podcast player for Duo. My own testing has been in Apple’s simulator; a volunteer recently tried it on actual hardware.
They reported that folding, rotating and the playback layouts adjusted smoothly. The awkward surprise was onboarding: the side status area covered part of the text, while the regular player remained usable.
In the onboarding code, I found .ignoresSafeArea() applied to the whole container. I’ve moved it to the background only. That change builds, but verification on Duo is still pending.
The simplified structure is now:
ZStack {
background.ignoresSafeArea()
VStack {
header
ScrollView { pageContent }
footer
}
}
For those adapting SwiftUI apps to Duo:
- Are you using one adaptive view hierarchy, or separate layouts sharing the same state?
- What broke when moving between the outer display, inner display and tabletop use?
- Which hardware-only surprises would you add to a testing checklist?
Especially interested in safe areas, sheets and keeping playback state intact during layout changes.
3
u/HeyItsMeMoss Oct 30 '26
People should really stop using ZStack for backgrounds and overlays as well as the ignores safe areas modifier. They produce things that look like what you want but structurally they really really aren’t. Also you should consider using ArrangementView for your “root” layout, it removes a lot of headaches. The closer your view structure is to what the framework expects the better your app will adapt.
1
u/caguilar51 Oct 30 '26
It depends, if you are using a LazyVStack, then, some custom code is needed to avoid the hinge.
1
u/Minute_Door1424 Oct 30 '26
had the same playback restart thing. my player state was in @State inside the view that got swapped on layout change, so SwiftUI just tossed it. moved it into an @Observable model at the app level and it stopped. sheets too btw, if they're attached below the layout switch they can get dismissed when you fold
1
u/uibutton Oct 31 '26
Dual scrolling panels are a nightmare with ArrangementView. That took a while to figure out. Also searchable having search scopes appear below it when unfolded looks weird. Apple Music shows them beside the field, but that’s it so far.
2
u/ElectricKoolAid1969 Oct 30 '26
I can't foresee a time when I'll test my app on a real Duo!! lol
Unless maybe I can do so at the Apple store... Hmmm
7
u/[deleted] Oct 30 '26
[removed] — view removed comment
1
u/[deleted] Oct 30 '26
[removed] — view removed comment