Is there some way to detect when the user changes keyboard types, specifically to the Emoji keyboard in this case?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- Get the NSRange for the visible text after scroll
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Xcode: Is there a way to change line spacing (UI L
- Swift - hide pickerView after value selected
- How do you detect key up / key down events from a
- didBeginContact:(SKPhysicsContact *)contact not in
You can use
UITextInputMode
to detect the current language of thecurrentInputMode
-- emoji is considered a language. From the docs:You can test for the emoji keyboard like this:
You can be notified of the input mode changing via the
UITextInputCurrentInputModeDidChangeNotification
. This will post when the current input mode changes.Here's a simple app which prints an
NSLog
whenever the mode changes:Or if you prefer Swift:
Swift 4: