Ber*_*lue 5 objective-c uitextview ios
是否可以在 iOS 上检测 Shift + Enter 组合键UITextView?
使用 Swift,你可以在子类中拦截Shift+组合,如下所示:EnterUIResponder
override var keyCommands: [UIKeyCommand]? {
get {
return [UIKeyCommand(input: "\r", modifierFlags: .shift , action: #selector(handleShiftEnter(command:)))]
}
}
func handleShiftEnter(command: UIKeyCommand) {
print("Combo pressed! Default action intercepted!")
}
Run Code Online (Sandbox Code Playgroud)