Skip to content

Utilizing new AppDelegate.swift format in React Native 0.77 #48

Description

@MikeLikesCode

Hey!

My team is upgrading to React Native 0.77 and we are migrating over to the new AppDelegate.swift file that the RN team shows in their template code. With that we had to migrate over from C to Swift for RN-Key-Command and came up with the following code.

class AppDelegate: ExAppDelegateWrapper {
...

  override var keyCommands: [UIKeyCommand]? {
    return HardwareShortcuts.sharedInstance().keyCommands() as? [UIKeyCommand]
  }

  func handleKeyCommand(_ keyCommand: UIKeyCommand) {
    HardwareShortcuts.sharedInstance().handleKeyCommand(keyCommand)
  }

}

After building this doesn't work and I was wondering if someone has come across this or if my implementation is wrong. Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions