The official way to use the new keypress sounds in iOS 10

My app contains a custom control that copies the behavior of a standard iOS keyboard.

I can successfully play the keypress sound of the system using this code:

UIDevice.current.playInputClick() 

On iOS 9 and below, there is only one click sound, and this call is all I need. On iOS 10, there are different click sounds for regular keys, for the backspace key, and for other special keys.

What is the official way to play these extra sounds? Should I use an alternate path from the linked answer? The documentation for playInputClick() says nothing.

There is an answer that suggests reproducing new click sounds using AudioServicesPlaySystemSound . But another answer says that these identifiers may not indicate the latest system click sounds in a future version of iOS. Another problem with the workaround is that there seems to be no way to check if the user has allowed keystrokes in the system settings ( link ).

+9
ios ios10 swift audio iphone-keypad
source share
1 answer

The link below can help find the right sound: https://github.com/TUNER88/iOSSystemSoundsLibrary

As of October 2019, these are sound identifiers

Click Click - ID: 1104

Click Delete - ID: 1155

Press modifier - ID: 1156

+8
source share

All Articles