Call emoji keyboard programmatically?

后端 未结 3 880
日久生厌
日久生厌 2021-01-11 15:33

It is possible to trigger the emoji keyboard programmatically?

I am trying to open the emoji keyboard when the user click in a button, it is possible?

3条回答
  •  一向
    一向 (楼主)
    2021-01-11 16:20

    Here is answer:

    Change the iOS keyboard layout to emoji?

    After that, do follow:

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        messageTextView.keyboardType = .asciiCapable
    }
    
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        messageTextView.keyboardType = .default
        messageTextView.reloadInputViews()
    }
    

    After press button call: messageTextView.reloadInputViews()

提交回复
热议问题