Vibrate iPhone 6S manually like peek and pop?

后端 未结 2 1021
野性不改
野性不改 2021-02-09 23:06

How can I manually trigger a single click-like vibration like the ones that happen when using peek&pop, or application shortcuts?

2条回答
  •  臣服心动
    2021-02-09 23:06

    This method is easy to implement and it works really well (I tried it myself)

    import AudioToolbox
    
    AudioServicesPlaySystemSound(1519) // Peek feedback
    AudioServicesPlaySystemSound(1520) // Pop feedback
    AudioServicesPlaySystemSound(1521) // Three pulses feedback
    

    I hope this helps! :)

提交回复
热议问题