如何选择系统键盘作为textField输入键盘的唯一类型?

时间:2018-07-28 04:18:38

标签: ios swift

我在视图中有一个文本字段,我只希望在用户在文本字段中输入文本时显示系统键盘。并且用户可能无法将键盘切换为自定义键盘。 Current view where the user can switch keyboard to other keyboards downloaded from the app store for example我该如何实现?

An app from app store where there is no the globe icon in the keyboard to switch the keyboard

1 个答案:

答案 0 :(得分:3)

将其添加到AppDelegate.swift文件中

func application(_ application: UIApplication, shouldAllowExtensionPointIdentifier extensionPointIdentifier: UIApplicationExtensionPointIdentifier) -> Bool {
    if (extensionPointIdentifier == .keyboard) {
        return false
    }

    return true
}