Index of every page on this site: llms.txt
All skills
kimeur avatar

/duo-navigation

@cffd95d
by Gazouzi Marouanekimeur/duology46 stars
2
Run it yourself

Gets toolbars, navigation bars, tab bars, split views and sheets right on iPhone Duo, Apple's foldable, where bars move into one vertical bar on the side of the outer display and of the inner display in landscape. Use it when bars go vertical, items overflow or vanish, an app draws its own custom bottom bar (UIToolbar, or a SwiftUI row in safeAreaInset or an overlay), toolbar or Menu buttons are icon-only, tabs should become a sidebar on the inner display, a sheet should sit to one side or off the fold, or code touches toolbarVerticalBehavior, toolbarVerticalEdge, axisBehavior, visibilityPriority, topBarPinnedTrailing, ToolbarOverflowMenu, toolbarVerticalCompressionBehavior, defaultTabBarPlacement, presentationPlacement, NavigationSplitView, preferredVerticalBarBehavior, verticalBarEdge, pinnedTrailingGroup, additionalOverflowItems, UITabBarController.Sidebar.preferredPlacement or UISheetPresentationController.preferredPlacement.

Use this Skill: https://skilld.dev/gh/kimeur/duology/duo-navigation

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesbar-rules.md

≈4k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Bar rules on iPhone Duo

Depth for ../SKILL.md. Each rule names its source. Measured means we ran a probe app on the iPhone Duo simulator (Xcode 27.1, iOS 27.1) on 16 October 2026, inner display, fully open, held wide. We did not change poses in that run, so the outer display, portrait, partially folded and Split View were not measured.

Sources

Tag Page
HIG Designing for iPhone Duo, sections Vertical controls, Split views, Arrangement views
Hub Preparing your app for iPhone Duo, sections Optimize bars for vertical presentation, Organize items in your bars
111461 Prepare your app for iPhone Duo
111462 Raise the bar with iPhone Duo
111463 Strike a pose with adaptive layouts on iPhone Duo
111466 Design for iPhone Duo
Prepare Three steps to make your app shine on iPhone Duo

Duology's full list, with IDs and check dates: reference/sources.md.

When bars go vertical

Context Result Source
Built with the iOS 26 SDK or earlier No vertical bars. Open: the app sits centred on the inner display at a familiar size, with empty space around it. Closed: it sits to the left of the status bar and camera Prepare, 111461
Built with the iOS 27 SDK No vertical bars. Open: the app fills most of the inner display but stays clear of the status bar. Closed: not described (unverified) Prepare, 111461
Built with the iOS 27.1 SDK or later Vertical bars where the pose calls for them Prepare, 111461
Outer display, portrait or landscape Vertical HIG, 111462
Inner display, landscape Vertical HIG, 111462; measured (trailing edge)
Inner display, portrait Horizontal top and bottom bars HIG, 111462, 111466
Split View multitasking Each app's bar on its outer edge; the left app's bar on the left HIG, 111466
Right-to-left languages Same hardware edge; content flows around it HIG, 111462
Bars from a hand-built UIToolbar, UINavigationBar or UITabBar Ignored for vertical layout Hub, 111462
A SwiftUI row of buttons in safeAreaInset or an overlay Stays where you drew it; move the buttons into .toolbar Our reading: it is your own content, not a system bar, so nothing moves it
Keyboard accessory bars Stay attached to the keyboard 111462

The vertical bar shares its strip with the Dynamic Island and the status bar. When space runs out, items move into the overflow menu (111466).

What goes into the vertical bar

Item Vertical? Source
Symbol, with or without a title Yes, shown as the symbol Hub
Title only No, stays horizontal Hub, 111462
Custom view No, unless axisBehavior is .verticalPreferred Hub, 111462
Item with .horizontalOnly Never; hidden if no horizontal bar exists SwiftUI doc
System EditButton Stays horizontal on its own 111462
Items in the overflow menu Shown with symbol and title Hub

Measured:

  • A text-only item ("EditText") and a .horizontalOnly item stayed in a horizontal bar at the top, next to the title, while the other items went vertical.
  • In UIKit, a symbol item placed in the same UIBarButtonItemGroup as a text-only item stayed horizontal with it. In SwiftUI we did not test a mixed group.

Inside the vertical bar:

  • Top-bar items sit at the top, bottom-bar items at the bottom, and the tab bar at the foot. The system keeps a gap between the top and bottom sets (HIG, 111466).
  • Items keep their groups. Flexible spacers have zero size on the vertical axis; fixed spacers keep their minimum size (111462).
  • The vertical bar has no scroll-edge effect by default. With Reduce Transparency on it gets a background, so custom item views must stay legible on both (111462).
  • Measured order with a .cancellationAction Close, a .topBarPinnedTrailing Done, a ToolbarOverflowMenu and a .bottomBar group: Close, Done, overflow button at the top; the group at the bottom.

Which screen decides

toolbarVerticalBehavior(_:) is resolved per window, or per presentation inside a sheet. Containers pick one view to ask (doc):

Container Asks
NavigationStack The top view of the stack
TabView The selected tab
NavigationSplitView The trailing-most column
Sheet Its own content

UIKit works the same way through childForPreferredVerticalBarBehavior: UINavigationController forwards to its top view controller and UITabBarController to its selected one (doc). A custom container should forward too.

When the choice changes, the system animates: bars move between axes, the status bar turns, and the side inset appears or goes. Measured (UIKit): after setNeedsUpdateOfVerticalBarConfiguration() with .disabled, the trailing safe-area inset went to 0, the bottom toolbar came back, and verticalBarEdge changed to .unspecified.

Overflow and compression

  • Default overflow order: from the bottom of the bar upward (HIG, 111462).
  • ToolbarItemVisibilityPriority: .automatic, .low, .high, and init(lowerThan:) / init(higherThan:) for values in between. A custom value never crosses the next system level (doc).
  • UIBarButtonItemVisibilityPriority: .standard, .low, .high, with the same two initializers. A group made implicitly from items takes their priority (doc).
  • Rank in this order: frequent actions such as Compose or New Note; items that show status, such as badges; the rest (HIG).
  • topBarPinnedTrailing items overflow only while search is active and space runs out (doc). UIKit's pinnedTrailingGroup never overflows; give it a representativeItem when it holds more than one item (doc).
  • ToolbarOverflowMenu content always sits in the overflow menu (doc). Setting additionalOverflowItems in UIKit shows the overflow button even when the menu is otherwise empty (doc).
  • Space runs short most on the outer display in landscape, and when the keyboard or Picture in Picture takes room (111462).
Compression value Keeps Use for Source
.automatic The tab bar (on iOS) Default doc
.prefersTabBar The tab bar; toolbar items overflow first Navigation screens, such as Podcasts doc, 111462
.prefersToolbarItems (UIKit .prefersBarItems) Toolbar items; the tab bar shrinks first Task screens, such as Files or Games doc, 111462

Talk 111462 calls the SwiftUI modifier "toolbarCompressionBehavior". The real name is toolbarVerticalCompressionBehavior(_:).

Split views and inspectors

  • Closed: columns collapse into one stack. Open: columns show tiled or as overlays (111461).
  • Partially folded: the system resizes columns into an even split around the fold (HIG, 111463).
  • Only the column on the display edge joins the vertical bar: the detail column. Sidebar and content columns keep horizontal bars. An expanded inspector gets no vertical bar of its own (Hub, 111462).
  • Measured (SwiftUI): the detail column's toolbar went vertical on the trailing edge; the sidebar's toolbar stayed horizontal; the sidebar column reported a compact width class while the detail column reported regular.
  • Controls that act on the list belong on the list column; controls for the open item belong on the detail column (HIG, Mail example).
  • Arrangement views lay out content but don't navigate. Never put a navigation container inside an arrangement (HIG, 111463). Never put an arrangement inside a list or scroll view (Hub, 111463).
  • Apple's pages disagree on split views. The Hub advises against an arrangement inside a navigation split view; the HIG names split views and tab views as containers to put around an arrangement. Duology's default: put an arrangement inside a NavigationStack or a TabView tab, not inside a split view column.

Tabs and the sidebar

  • By default tabs show on both displays and go vertical where the pose calls for it. On the inner display you can opt into a sidebar (111461).
  • Apple suggests a sidebar for information-dense apps, such as Health (111466).
  • SwiftUI: defaultTabBarPlacement(_:) applies to .sidebarAdaptable tab views, on platforms where the bar can't switch between forms. It does nothing on iPad (doc).
  • UIKit: sidebar.preferredPlacement matters only where sidebar and tab bar can't both show. .automatic means a tab bar on iOS (doc).
  • Measured (SwiftUI): .sidebarAdaptable plus .defaultTabBarPlacement(.sidebar) showed a sidebar on the inner display. isTabViewSidebarAvailable was true. tabBarPlacement still read bottomBar.
  • Measured (UIKit): with mode left at .automatic and no tab groups, preferredPlacement = .sidebar showed a vertical tab bar and sidebar.isAvailable was false. With mode = .tabSidebar the sidebar showed and isAvailable was true. Apple's header says .automatic resolves to .tabSidebar only when a tab is a group.
  • Gate sidebar-only UI on isTabViewSidebarAvailable or sidebar.isAvailable (doc).

Sheets and other presentations

Where Default With a placement Source
Outer display Toolbar vertical Turn it off in the sheet for a single Close item; the sheet then stops short of the front camera and the status bar moves Hub, 111466
Inner display Centred, toolbar horizontal .leading: horizontal. .trailing: vertical Hub, 111462; measured in SwiftUI
Partially folded Slides off the fold Not needed 111466
  • Measured (SwiftUI): a .medium sheet with .trailing placement sat on the right with a vertical bar (Close at the top). With .automatic or .leading it had a horizontal bar, and toolbarVerticalEdge read nil inside it. Each sheet reported a compact width class.
  • Talk 111462 describes the inner-display rule as left and right; the hub says leading and trailing. Unverified: which wins in right-to-left languages.
  • UISheetPresentationController.preferredPlacement is ignored when sourceView is set (UIKit header UISheetPresentationController.h).
  • Alerts, action sheets, menus and popovers reposition around the fold on their own. Partially folded and held like a book, alerts move to the trailing side, close to where they appear once the phone closes (111463).

Margins and backgrounds

  • Bars sit outside the safe area. Horizontal bars add top and bottom insets; vertical bars add leading or trailing insets (111461).
  • Margins are asymmetric too: content can get closer to the vertical bar while the other side keeps its margin (111461). ContentMarginGuide.container gives these margins; Apple says they can differ per side next to a vertical bar (doc).
  • Measured (SwiftUI and UIKit): with a vertical bar on the trailing edge, the trailing content margin inside the safe area was 0 and the leading one was the usual system margin.
  • Let hero art run under the bar with backgroundExtensionEffect() (SwiftUI) or UIBackgroundExtensionView (UIKit) (Hub).
  • Layouts that don't scroll and need no bars, like Calculator, can span the full width if nothing hits the Dynamic Island or the status bar (HIG).

Availability

API Since
toolbarVerticalBehavior(_:), toolbarVerticalEdge, toolbarVerticalCompressionBehavior(_:), axisBehavior(_:), contentMargins(for:edges:alignment:) iOS 27.1
preferredVerticalBarBehavior, childForPreferredVerticalBarBehavior, setNeedsUpdateOfVerticalBarConfiguration(), verticalBarEdge, systemTraitsAffectingVerticalBarEdge, verticalBarCompressionBehavior, UIBarButtonItem.axisBehavior iOS 27.1
visibilityPriority(_:), topBarPinnedTrailing, ToolbarOverflowMenu, toolbarOverflowMenu(content:), defaultTabBarPlacement(_:), isTabViewSidebarAvailable, presentationPlacement(_:) iOS 27.0
UIBarButtonItem.visibilityPriority, UITabBarController.Sidebar.preferredPlacement, .isAvailable, sidebarAvailabilityDidChange, UISheetPresentationController.preferredPlacement iOS 27.0
backgroundExtensionEffect(), UIBackgroundExtensionView, ButtonRole.close, .confirm, UIBarButtonItem.badge iOS 26.0
.sidebarAdaptable, UITabBarController.mode, UITab iOS 18.0
pinnedTrailingGroup, additionalOverflowItems, leadingItemGroups iOS 16.0

All checked in the iOS 27.1 simulator SDK interfaces. Duology's full API table: reference/api-index.md.

Re-check on the simulator

Drop this view into any screen to log the bar edge, safe area and margins. Change poses in Device Hub and read the console.

import SwiftUI

struct BarProbe: View {
    let tag: String
    @Environment(\.toolbarVerticalEdge) private var edge
    @Environment(\.horizontalSizeClass) private var widthClass

    var body: some View {
        GeometryReader { proxy in
            let inset = proxy.safeAreaInsets
            let margin = proxy.contentMargins(for: .container, edges: .horizontal)
            let line = "\(tag) edge=\(String(describing: edge)) width=\(String(describing: widthClass)) "
                + "safe(leading \(inset.leading), trailing \(inset.trailing), top \(inset.top), bottom \(inset.bottom)) "
                + "margins(leading \(margin.leading), trailing \(margin.trailing))"
            Text(line)
                .font(.caption)
                .onAppear { print("BARPROBE", line) }
                .onChange(of: line) { _, new in print("BARPROBE", new) }
        }
    }
}

Still to check

  • Every rule above on the outer display, in portrait on the inner display, partially folded and in Split View. We measured only the inner display, fully open, held wide.
  • Whether the outer display keeps a tab bar when the app asks for a sidebar.
  • Whether .horizontalOnly items hide on screens with no title and no horizontal bar.
  • Mixed text and symbol groups in SwiftUI.
  • Sheet placement in right-to-left languages.
  • Everything on a real iPhone Duo.

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts1mo3 checks · Risk SAFE
  • Gen Agent Trust Hub1mo

    This skill provides technical guidelines and code recipes for optimizing iOS applications for the iPhone Duo foldable device using the iOS 27.1 SDK. It includes audit scripts for local code analysis and examples for SwiftUI and UIKit.

  • Socket1mo

    No alerts

  • Snyk1mo

    Risk: LOW · No issues

Signed by skilld at cffd95d. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated last month
Other metadata
metadata
{
  "verified": "Xcode 27.1 (27A9275), iOS 27.1 simulator, device: no",
  "sources": "https://github.com/Kimeur/duology/blob/main/reference/sources.md"
}

README badge

README badge for kimeur/duology/duo-navigation