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:
To just remove the Undo, Redo, Copy and Paste options but show suggestions on top of keyboard, call the function func removeUndoRedoOptions()
To completely remove the suggestion bar along with Undo, Redo, Copy and Paste options, call the function func hideSuggestions()
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
Iaps Actually Validating the Receipt (Swift)
Swift 3 and Firebase: Retrieve Auto Id Value from Snapshot
Proper Model for Multiple Alamofire Requests for Multiple Websites
Convert or Cast Object to String
Converting String to Data in Swift 3.0
Variable P Passed by Reference Before Being Initialized
Swift3:How to Handle Precedencegroup Now Operator Should Be Declare with a Body
Swift + Nsviewcontroller Background Color (MAC App)
Swiftui - How to Set the Title of a Navigationview to Large Title (Or Small)
Checking If a Swift Class Conforms to a Protocol and Implements an Optional Function
How to Get Class Name of Parent Viewcontroller in Swift
Format String with Trailing Zeros Removed for X Decimal Places in Swift
Executefetchrequest Doesn't Return the Nsmanagedobject Subclass
How to Navigate to a New View from Navigationbar Button Click in Swiftui