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.