8

How can I hide quicktype keyboard toolbar on iPad?

enter image description here

The following code doesn't work:

textField.autocorrectionType = UITextAutocorrectionTypeNo;
Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
Dmitry
  • 14,306
  • 23
  • 105
  • 189

3 Answers3

19

place this code in viewDidLoad

yourTextFieldName.autocorrectionType = UITextAutocorrectionTypeNo;
UITextInputAssistantItem* shortcut = [yourTextFieldName inputAssistantItem];
shortcut.leadingBarButtonGroups = @[];
shortcut.trailingBarButtonGroups = @[];

Swift

    yourTextFieldName.autocorrectionType = .No
    let shortcut : UITextInputAssistantItem = yourTextFieldName.inputAssistantItem
    shortcut.leadingBarButtonGroups = []
    shortcut.trailingBarButtonGroups = []

swift3

 yourTextFieldName.autocorrectionType = .no
 var shortcut: UITextInputAssistantItem? =     yourTextFieldName.inputAssistantItem()
shortcut?.leadingBarButtonGroups = []
shortcut?.trailingBarButtonGroups = []

for reference

Anbu.Karthik
  • 82,064
  • 23
  • 174
  • 143
1

How to hide the shortcut bar in iOS9

Have you tried this yet? What you do is simply disable the text proposals, not the undo / redo / paste ... thingies.

Community
  • 1
  • 1
emmics
  • 994
  • 1
  • 11
  • 29
0

To hide shortcuts altogether, set the leadingBarButtonGroups and trailingBarButtonGroups properties to nil. Doing so hides only the shortcuts and does not hide the typing suggestions. To hide typing suggestions, you must also set the autocorrectionType property of the responder that displays the keyboard to UITextAutocorrectionTypeNo.

<editorView>.autocorrectionType = UITextAutocorrectionTypeNo;
UITextInputAssistantItem* shortcut = [<editorView> inputAssistantItem];
shortcut.leadingBarButtonGroups = @[];
shortcut.trailingBarButtonGroups = @[];
Dmitry
  • 14,306
  • 23
  • 105
  • 189