Is there some way to detect when the user changes keyboard types, specifically to the Emoji keyboard in this case?
Swift 4:
NotificationCenter.default.addObserver(self,
selector: #selector(FirstViewController.changeInputMode(_:)),
name: NSNotification.Name.UITextInputCurrentInputModeDidChange, object: nil)
func changeInputMode(_ notification: Notification)
{
let inputMethod = UITextInputMode.activeInputModes.description
print("keyboard changed to \(inputMethod.description)")
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With