My app contains a custom control that copies the behaviour of the iOS standard keyboard.
I can successfully play the system keyboard click sound with 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 additional sounds? Do I have to use the alternative way from the linked answer? The documentation for playInputClick()
does not mention anything.
There is an answer that suggests to play the new click sounds using AudioServicesPlaySystemSound
. But another answer says that these IDs might not point to 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 enabled keyboard clicks in the system settings (link).