禁用特定文本字段的自定义键盘

Pra*_*hwa 5 keyboard textfield ios swift

我试图禁止用户在我的文本字段之一中使用自己的键盘。在进行研究时,我发现我需要以下代码来禁用自定义键盘:

func application(application: UIApplication, shouldAllowExtensionPointIdentifier extensionPointIdentifier: String) -> Bool {
    if extensionPointIdentifier == UIApplicationKeyboardExtensionPointIdentifier {
        return false
    }
    return true
}
Run Code Online (Sandbox Code Playgroud)

但是,我不想禁用所有文本字段的键盘。如何将其仅应用于特定文本字段?谢谢!