How to play keyboard click sound in custom keyboard?

后端 未结 3 979
囚心锁ツ
囚心锁ツ 2020-12-16 13:29

I had created custom keyboard with UIView. However I didn\'t hear click sound of keyboard. So I tried following codes.But I can\'t hear anythings. How can I pla

3条回答
  •  生来不讨喜
    2020-12-16 14:01

    Couldn't get any of this to work, but this worked for me:

    #import 
    
    AudioServicesPlaySystemSound(1104);
    

    But still I had to subclass a UIButton and add the UIInputViewAudioFeedback Protocol to it.

提交回复
热议问题