Created
December 10, 2015 02:03
-
-
Save ikhanhmai/a8c50a68020125293b43 to your computer and use it in GitHub Desktop.
iOS - is your Custom Keyboard enable?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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