UIDocumentBrowserViewController doesn't support custom key commands

Originator:matthias.tretter
Number:rdar://34734984 Date Originated:29-Sep-2017 11:05 AM
Status:Open Resolved:
Product:iOS + SDK Product Version:iOS 11.1
Classification:UI/Usability Reproducible:Always
 
Summary:
UIDocumentBrowserVC comes with its own set of Key Commands, which is great. However it would be desirable to add our own keyCommands to the already existing ones like so.

override var keyCommands: [UIKeyCommand]? {
        let custom = UIKeyCommand(input: "n",
                                  modifierFlags: [.alternate, .command],
                                  action: #selector(handleCustomKeyCommand),
                                  discoverabilityTitle: “Custom Key Command“)

        guard let superCommands = super.keyCommands else { return [custom] }

        return superCommands + [custom]
    }

Steps to Reproduce:
1. create a subclass of UIDocumentBrowserVC
2. override `keyCommands` as shown in Description

Expected Results:
Both the system-provided and the custom key commands work

Actual Results:
The custom keyCommand’s discoverabilityTitle actually shows up, if you hold Command, but the KeyCommand can’t be invoked and does nothing

Version:
iOS 11.1

Notes:
Custom KeyCommands worked in an early beta, before UIDocumentBrowserVC added its own

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!