Skip to content

Instantly share code, notes, and snippets.

@gopalkrishnareddy
Created October 9, 2018 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gopalkrishnareddy/5aecd590676a7e276d1fb36b067eb839 to your computer and use it in GitHub Desktop.
Save gopalkrishnareddy/5aecd590676a7e276d1fb36b067eb839 to your computer and use it in GitHub Desktop.
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 = []
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment