Categories
- Code (3)
- Code Snippets (12)
- git (1)
- Hardware (1)
- News (5)
- Objective-C (6)
- Precompiled (4)
- Programming (1)
- Review (1)
- Swift (9)
- Swift Standard Library (3)
- Tips (3)
- Tutorial (22)
- Uncategorized (3)
- WWDC (1)
-
Recent Posts
Meta
-
Tag Archives: playInputClick
Snippet: Handling Key Clicks in a Custom Keyboard
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:
Objective-C
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 … Continue reading →
Posted in Code Snippets
|
Tagged enableInputClicksWhenVisible, playInputClick, UIInputViewAudioFeedback
|
Leave a comment