Official way to use the new keyboard click sounds in iOS 10
Asked Answered
T

1

15

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).

Triolet answered 23/9, 2016 at 22:33 Comment(1)
Did you find a solution? I am having the same issue...Picrite
S
17

The url below could help with finding proper sound: https://github.com/TUNER88/iOSSystemSoundsLibrary

As of October 2019, these are the sound IDs

Press Click - ID: 1104

Press Delete - ID: 1155

Press Modifier - ID: 1156

Skidproof answered 3/1, 2017 at 13:23 Comment(1)
For me it was 1104 instead of 1123 but I found the 2 others thanks to you!Indigotin

© 2022 - 2024 — McMap. All rights reserved.