1

This code works in MacOS, I expected to see all Commands on an iPad by long pressing CMD on a hardware keyboard and to fire if the Command is pressed on the hardware keyboard.

Unfortunately nothing happens on iPadOS (Simulator with iOS14-beta) long pressing CMD or pressing CMD-1.

Am I something missing or doing wrong on iPadOS or is this maybe a bug in Beta.

@main
struct KeyboardCommand_1App: App {
  var body: some Scene {
    WindowGroup {
      ContentView()
    }
    .commands {
      MyCommands()
    }
  }
}

struct MyCommands : Commands{
  var body: some Commands {
    CommandMenu("MyCommands") {
      Section {
        Button("Command 1", action: {print ("Command 1")})
        .keyboardShortcut("1")
        Button("Command 2", action: {print ("Command 2")})
          .keyboardShortcut("2")
      }
    }
  }
}

MacOS BigSur 11.0 Beta (20A5323l) (Beta 3)
Xcode Version 12.0 beta 3 (12A8169g)

mica
  • 3,898
  • 4
  • 34
  • 62

0 Answers0