How to play tock sound when tapping custom keyboard buttons

后端 未结 6 754
闹比i
闹比i 2020-12-29 16:09

I\'ve been working on a custom keyboard for iOS 8 for some time and everything went fine so far, but I still couldn\'t get my head around this tapping sound stuff.

I

6条回答
  •  离开以前
    2020-12-29 16:54

    As Farzad Nazifi mentioned above Allow openAcesess after a fresh install , solved my issue . And I recommend a simpler solution for playing system keyboard tap sound

    Swift and Objective-C All the same `we don't need to import any custom sound file just play the system tap sound.

    Import AudioToolbox framework:

    #import

    AudioServicesPlaySystemSound(1104)
    

    This code is tested in iOS 8 beta 5 , I hope apple would fix the bug (if it is a bug) in the GM version .

提交回复
热议问题