What are the system sound ids for the new keyboard clicks in iOS 10?

前端 未结 2 774
鱼传尺愫
鱼传尺愫 2021-02-08 14:40

General
I\'m developing a third party keyboard and am currently trying to mimic the new keyboard clicks that Apple introduced in iOS 10b4.

相关标签:
2条回答
  • 2021-02-08 14:52

    Implemented in swift using an enum (extend with your own other system sound id's):

    import AudioToolbox
    
    
    enum SystemSound: UInt32 {
    
        case pressClick    = 1123
        case pressDelete   = 1155
        case pressModifier = 1156
    
        func play() {
            AudioServicesPlaySystemSound(self.rawValue)
        }
    
    }
    

    and use like this:

    @IBAction func pressedDigit(sender : UIButton) {
        SystemSound.pressClick.play()
    }
    
    0 讨论(0)
  • 2021-02-08 14:57

    iOS 10.0 - iOS 11.0 b5

    Press Click - ID: 1123

    Press Delete - ID: 1155

    Press Modifier - ID: 1156

    Comment (1): Same IDs work for iOS 11 beta 5

    0 讨论(0)
提交回复
热议问题