         super.didReceiveMemoryWarning()
         // Dispose of any resources that can be recreated.
     }
-
+    
+    func isCustomKeyboardEnabled() -> Bool {
+        let bundleID = "name.guoc.SPi.SPiKeyboard"
+        if let keyboards: [String] = NSUserDefaults.standardUserDefaults().dictionaryRepresentation()["AppleKeyboards"] as? [String] {   // Array of all active keyboards
+            for keyboard in keyboards {
+                if keyboard == bundleID {
+                    return true
+                }
+            }
+        }
+        return false
+    }
+    
 
 }
 

        appSettingsViewController.showCreditsFooter = false
        appSettingsViewController.showDoneButton = false
        appSettingsViewController.title = "SPi 双拼输入法"
    }

    required init(coder aDecoder: NSCoder) {


class ViewController: UINavigationController, IASKSettingsDelegate {
    
    var appSettingsViewController: IASKAppSettingsViewController!
    
    override init() {
        var appSettingsViewController = IASKAppSettingsViewController()
        super.init(rootViewController: appSettingsViewController)
