In a custom keyboard or input accessory you may want to support audio feedback or, as they say on the street, key clicks.
The code snippet below summarizes how to do this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
// Adopt the UIInputViewAudioFeedback protocol @interface CustomKeyboardAccessoryView : UIView< UIInputViewAudioFeedback> { } ... @end // Implement protocol - (BOOL)enableInputClicksWhenVisible { return YES; } // When you should click call [[UIDevice currentDevice] playInputClick]; |
Reference
Text, Web and Editing Programming Guide for iOS: Playing Input Clicks