I have subclassed UITextField and implemented the UIKeyInput protocol\'s deleteBackward method to detect backspace being pressed. This works fine on iOS 7 but not on iOS 8.<
swift 2:
if (string.characters.count == 0 && range.length == 1) { return true }
you should use like this string.characters.count
string.characters.count