In UIKit you can create keyboard shortcuts by overriding the keyCommands for your view controller, which is an array of UIKeyCommand. A bit of a different approach to how you'd do it with SwiftUI.

Calendar app opened on an iPad. There is a panel that shows the keyboard shortcuts available because the user is pressing and holding the command key. One of them is command + n to create a new event. You can override keyCommands which is an array of UIKeyCommand. In this case we configure

You may also find interesting...

Adding keyboard shortcuts in your SwiftUI apps is extremely easy. Just use the .keyboardShortcut(_:) modifier. When pressing and holding the command key, the shortcut will appear in the shortcuts list.

There are a few accessibility settings you can check for, or get notifications in case these preferences change. This is especially important when developing custom components as they will mostly work with UIKit controls.

Manual testing is crucial. And therefore, reducing friction to let you start your testing process can be a huge help. Selecting some accessibility shortcuts will do that, putting most of iOS' accessibility features at a triple-click of a button.

Created in Swift with Ignite.

Supporting Swift for Swifts