navigationTitle with menu

I am trying to reproduce the new navigation title menu for iPad

    // toolbar customizations ...
    .navigationTitle($place.name) {
        MyPrintButton()
    }

from WWDC2022 presentation (SwiftUI on iPad: Add toolbars, titles and more) and I was not able to do this.

Can anyone do this? or maybe failed like me?

Answered by BabyJ in 719976022

In beta 1, navigationTitle(_:actions:) was how you would set the menu's actions.

In beta 2, a new modifier was added for this instead. It was called toolbarTitleActions(actions:).

As of beta 3, you will have to use the renamed toolbarTitleMenu(content:) modifier, like this:

.toolbarTitleMenu {
    MyPrintButton()
}



Note: the menu will only show when the navigation title display mode is .inline.

Accepted Answer

In beta 1, navigationTitle(_:actions:) was how you would set the menu's actions.

In beta 2, a new modifier was added for this instead. It was called toolbarTitleActions(actions:).

As of beta 3, you will have to use the renamed toolbarTitleMenu(content:) modifier, like this:

.toolbarTitleMenu {
    MyPrintButton()
}



Note: the menu will only show when the navigation title display mode is .inline.

thank you very much; it works nicely with .toolbarTitleMenu I hope Apple will update WWDC2022 video;

navigationTitle with menu
 
 
Q