In iOS13, how can I access the main menu in an iPad app

I’m going through the sample project:

https://developer.apple.com/documentation/uikit/uicommand/adding_menus_and_shortcuts_to_the_menu_bar_and_user_interface?language=objc


For the mac app I get access the main menu bar e.g. by tapping `cmmd + 0` I can access the main menu >> cities >> Cupernito


I tried the same on my iPad simulator but nothing happens. I wonder how I can access that main menu on the iPad? Is there is a shortcut or something?

Accepted Reply

So I just tried adding a main menu using storyboards. The pop up was pretty revealing that the main menu only belongs to MacOS.


See the following screenshot https://imgur.com/s5ozHu0


Contains the default set of menus and commands to be used as the main menu on macOS



Replies

The menu bar does not show on iPad.


But if you type, for instance, cmd-n on the Master/Detail view, you get new items.


So yes, AFAIK, menu is accessible on Mac only (but you get contextual menus on iPad).

Thanks.
Yes I'm aware that I can access `cmmd+N`. That part is working on the iPad.
To be more precise.
I don't want the menu bar, I want to it to build the main menu.

Is it really impossible for the iPad's context to ever be main?

FWIW:
On the iPad, this block succeeds:

if builder.system == .main {
    menuController = MenuController(with: builder)
}

It's a bit odd for it to succeed to build something that it never uses and the sample code is considerate of doing two checks like `targetEnvironment(macCatalyst)`



Hence I'm still skeptical about it not working. Any thoughts?

So I just tried adding a main menu using storyboards. The pop up was pretty revealing that the main menu only belongs to MacOS.


See the following screenshot https://imgur.com/s5ozHu0


Contains the default set of menus and commands to be used as the main menu on macOS