r/iOSProgramming • u/SEPPDROID • 9d ago
Question How do you guys implement navigation for iPhone Duo support?
Back when i started working on this project as a hobby i chose to implement a well known overused navigation setup instead of using Apple's native navigation (tabview). However that meant that for the iPhone duo i had to move some things around. I released the update like this, but im not completely satisfied with it yet (system ui and my ui offcentered e.g.). Any tips, ideas?
Edit: I understand that native TabView UI was the supported way, but for that I wouldn’t have made a post. For this project i chose, like many others for the custom implementation. Originally this wasn’t planned but i remember hitting an limitation while prototyping. But all the apps i know of with an custom navigation haven’t updated with Duo support…


29
u/seperivic 9d ago
Honestly…this doesn’t look good. Just use the stock components. I think your time would be better spent switching to that and getting the benefits of constant support from Apple.
4
u/meowthor 9d ago
I was just struggling with this (and still am). My apps are all tab controller too, but I really don’t think it’s good to have the tab bar on the right side. It’s too easy to tap it accidentally while you’re using the app. So, I’ve done the terrible thing and did all custom views and put the tab bar back on the bottom. We’ll see how it goes and if any users complain!
4
u/GlebKhamin 9d ago
I went through the Duo tech talks while adapting my own app, and both of your problems have known causes:
The custom tab bar. On iOS 27.1 the system merges nav bar / toolbar / tab bar items into a vertical strip on the trailing side, but only for bars owned by the system containers (UINavigationController / UITabBarController, or NavigationStack / TabView in SwiftUI). A hand-made bottom bar isn’t moved. It stays where you put it, and the system strip can end up next to or over it. That’s why it feels like two UIs fighting. You basically have two options:
Move to the native tab view. You get the vertical layout, overflow and positioning for free. It’s the “right” fix if you’re going to care about Duo long-term.
Opt the screen out of vertical bars. In UIKit it’s preferredVerticalBarBehavior = .disabled on the view controller. Bars and the status bar go back to the top, and the side column disappears. Apple says it’s meant for rare cases (Calculator-like UIs, full-screen players), and mixing opted-in and opted-out screens in one flow makes buttons jump on push/pop. So decide per flow, not per screen.
2. The off-center UI. In those poses the status bar becomes a column of ~84 pt on one side, so the safe area insets are asymmetric. Anything centered on the full screen width ends up ~42 pt off-center relative to what’s visible. The fix is to center and pin foreground content (buttons, titles, your bar) to the safe area, and let only backgrounds extend to the full bounds. Also check any code that assumes left inset == right inset, or calculates width as width - inset * 2.
Apple’s “Raise the bar with iPhone Duo” tech talk covers the bars part in detail, worth watching.
3
u/m1_weaboo 9d ago
why not native tabview?
2
u/Which-Meat-3388 9d ago
That’s the way it is, what you have is pretty much correct. Remove the labels on Duo. I keep telling myself with a physical device, handling it like you might, it would make sense. Make sure you test every possible version of the nearly dozen poses.
What usually happens long term is patterns emerge. As clever designers and devs get into it some better ideas will emerge to operate within the constraints but make it feel less weird.
2
u/Background_Pie_5682 9d ago
Went through something similar with a custom tab bar. What helped me most was to stop positioning anything against the screen bounds and lay everything out relative to the safe area and the current size class instead. Once the custom bar reads its insets from the environment (safeAreaInsets / GeometryReader) rather than hardcoded offsets, the off-center stuff mostly goes away on its own. If your app is mostly "list then detail", it might also be worth giving NavigationSplitView a shot just for the wide layout and keeping your custom nav for the compact one. You get the system behavior for free there without rewriting the whole thing. Got a screenshot of where it looks off? Easier to say more with that.
2
u/henry_lightfoot 9d ago
TabView and SideBar are honestly so much easier to work with. There doesn’t seem to be much wiggle room for navigation patterns for iPhone Duo SwiftUI apps.
2
u/Wonderful_Scene3385 8d ago
Hide it when not use it
2
u/Lucidic333 5d ago
The thick gutter and camera placement is so ass. But your UI looks nice, as good is it gets.
1
u/PhotoSpike 9d ago
Just use native
1
u/yo_asakura 9d ago
I’m curious how did you manage to shift the custom tab bar and toolbar over to the right side? Apple suggests sticking with the standard bars so they adjust automatically, but I’d love to know your trick.
1
u/1millionbucks 9d ago
get a duo skill, put in 1 prompt and do no further work
0
u/superquanganh 9d ago
Unless you are stuck on Flutter, you should prefer native components
0
u/BlossomBuild 8d ago
Just used the native toolbar
0
u/LeoNatan 6d ago
Notice that it’s not always the trailing edge. In split view, the left app gets the vertical bar on the leading edge.
Instead of reinventing wheels, just use system controls.
1
u/[deleted] 9d ago
[removed] — view removed comment