iOS 9 iPad Keyboard Get Rid of "Undo View"

iOS 9 iPad Keyboard get rid of undo view

For Swift 2.0, You can place this code in viewDidLoad and it will work like a charm.

if #available(iOS 9.0, *) {
let item = yourTextView.inputAssistantItem
item.leadingBarButtonGroups = []
item.trailingBarButtonGroups = []
} else {
// Fallback on earlier versions
}

In Swift 3.0 and 4.0

youtTextField.inputAssistantItem.leadingBarButtonGroups.removeAll()
yourTextField.inputAssistantItem.trailingBarButtonGroups.removeAll()

However the best way to use this is to subclass a UITextfield and use the above code in the init() phase. Or to create an extension Instead of using it in the viewDidLoad for each and every textField.

How to hide KeyBoard in ios9 (Ipad)

"it is showing only in simulator if you try on device it will hide shortcuts also hide on device." – johny kumar

How to hide the shortcut bar in iOS9

You can pass your textfield name in place of userNameTextField for which you want to remove shortcut bar.

UITextInputAssistantItem* item = [userNameTextField inputAssistantItem];
item.leadingBarButtonGroups = @[];
item.trailingBarButtonGroups = @[];

Swift: Disable or Clear Undo for a TextField

The answer was simple in the end, I used undoManager removeAllActions, but instead of just needing:

undoManager?.removeAllActions()

as a line, I needed:

myTextField.undoManager?.removeAllActions()

I placed this in the DidChange Action for the TextField.

iPad dismiss keyboard button (lower right), how do I detect when this occurs? What function tells me it was pressed?

You can listen for keyboard hide UIKeyboardWillHideNotification notification.

Example code is here http://developer.apple.com/iphone/library/samplecode/KeyboardAccessory/Listings/Classes_ViewController_m.html

How to hide the keyboard clipboard programmatically?

On iPhone you could just set autocorrectionType = .no to completely remove that bar above the keyboard.

On iPad however you should first add these extensions:

extension UITextView {
func hideSuggestions() {
// Removes suggestions only
autocorrectionType = .no
//Removes Undo, Redo, Copy & Paste options
removeUndoRedoOptions()
}
}

extension UITextField {
func hideSuggestions() {
// Removes suggestions only
autocorrectionType = .no
//Removes Undo, Redo, Copy & Paste options
removeUndoRedoOptions()
}
}

extension UIResponder {
func removeUndoRedoOptions() {
//Removes Undo, Redo, Copy & Paste options
inputAssistantItem.leadingBarButtonGroups = []
inputAssistantItem.trailingBarButtonGroups = []
}
}

Before:


Before

  1. To just remove the Undo, Redo, Copy and Paste options but show suggestions on top of keyboard, call the function func removeUndoRedoOptions()
    After

  2. To completely remove the suggestion bar along with Undo, Redo, Copy and Paste options, call the function func hideSuggestions()
    After

How can I hide quicktype keyboard toolbar on iPad?

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



Related Topics



Leave a reply



Submit