Skip to content

Instantly share code, notes, and snippets.

@ikhanhmai
Created December 10, 2015 02:03
Show Gist options
  • Save ikhanhmai/a8c50a68020125293b43 to your computer and use it in GitHub Desktop.
Save ikhanhmai/a8c50a68020125293b43 to your computer and use it in GitHub Desktop.
iOS - is your Custom Keyboard enable?
func isCustomKeyboardEnabled() -> Bool {
let bundleID: String = "com.app.smappikeyboard.child"
// Replace this string with your custom keyboard's bundle ID
NSUserDefaults.standardUserDefaults().dictionaryRepresentation()
let keyboards: [String] = NSUserDefaults.standardUserDefaults().dictionaryRepresentation()["AppleKeyboards"]! as! [String]
// Array of all active keyboards
for keyboard: String in keyboards {
print("keyboard",keyboard)
if (keyboard == bundleID) {
return true
}
}
return false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment