判断键盘是否是自己的键盘 只有在键盘开启的情况才可以判断
func isCustomKeybroad() -> Bool{
let currentKeyboardName = (((UITextInputMode.activeInputModes as NSArray).filtered(using: NSPredicate(format: "isDisplayed = YES"))).last as? NSObject)?.value(forKey: "extendedDisplayName") as? String
let infoDictionary = Bundle.main.infoDictionary!
let appDisplayName = infoDictionary["CFBundleDisplayName"] as? String 应用名称
return currentKeyboardName == appDisplayName
}