Contents

addKeyCommand(_:)

Associates the specified keyboard shortcut with the view controller.

Declaration

func addKeyCommand(_ keyCommand: UIKeyCommand)

Parameters

  • keyCommand:

    The key command to add.

Discussion

This method lets you easily add key commands to the view controller without overriding the keyCommands property. The key commands you add to a view controller are applied to the active responder chain. When the user performs a key command, UIKit searches the responder chain (starting with the first responder) for an object capable of handling the specified action.

See Also

Related Documentation

Accessing the available key commands