I hereby claim:
- I am naknut on github.
- I am naknut (https://keybase.io/naknut) on keybase.
- I have a public key ASDaT3bujEItW5cUOFqFrp5DqHcOxGRFnMCuB-nl7ZomVAo
To claim this, I am signing this object:
func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -> Bool { | |
let newText = ((textField.text as NSString?) ?? "").replacingCharacters(in: range, with: string) | |
guard newText.count > 0 else { | |
return true | |
} | |
guard (newText.filter{ $0 == Character(Locale.current.decimalSeparator!) } as [Character]).count <= 1 else { // Make sure we only have one decimal separator | |
return false | |
} | |
let numbersSet: Set<Character> = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"] | |
var withoutSeperator = newText |
I hereby claim:
To claim this, I am signing this object: