How to remove diacritics (or accents) from a String (like say change \"één\" to \"een\") in Swift? Do I have to go back to NSString or can it be do
String
NSString
Answer update for Swift 5.0.1
Swift 5.0.1
func toNoSmartQuotes() -> String { let userInput: String = self return userInput.folding(options: .diacriticInsensitive, locale: .current) }
and use it someTextField.text.toNoSmartQuotes()
someTextField.text.toNoSmartQuotes()