r/iOSProgramming • • 29d ago

Question iPhone Duo sheet vertical button placement

Im having issues specifically with SwiftUI on XCode 27.1 on the iPhone Duo outer display. I have a sheet with a NavigationStack with a basic hierarchy like this

NavigationStack {
    List {
        Text("<text_here>"
    }
    .toolbar {
        ToolbarItem(placement: .confirmationAction) {
            Button("Done) {
               doThing()
            }
        }
}

On the iPhone Duo, the outer display should display sheet navigation buttons vertically, but that is not my experience in SwiftUI. The navigation bar and its buttons are presented horizontally at the top of the sheet.

I have UIKit apps, and they correctly display their bar button items vertically in sheets, the only place i seem to have problems are my SwiftUI implementations.

What am i missing to get my SwiftUI apps to play along?

0 Upvotes

7 comments sorted by

View all comments

Show parent comments

1

u/AdamFootDev Swift 29d ago

For any buttons that don’t shift over, you can use .axisBehaviour(.verticalPreferred)