Because the project needs, the need to add a bank card and withdrawal page using the numeric keypad, if the user does not install a third-party keyboard is not a big problem, but if the user's phone installed a third-party keyboard, sometimes will not be able to call the third-party digital keyboard, or third-party keyboard style does not match, This time the system's numeric keypad is more in line with our needs. So how do we use the system's own numeric keypad on a particular page?
In fact, we simply need to implement the following proxy method Uiapplicationdelegate:
///The purpose of this method is whether to use a third-party keyboard/// ///-Parameters:///-Application:application Object///-Extensionpointidentifier: Identification of third-party keyboards///-Returns:true indicates that using a third-party keyboard fanse means not usingFunc Application (_ Application:uiapplication, Shouldallowextensionpointidentifier extensionpointidentifier: Uiapplicationextensionpointidentifier)Bool {//Traverse all sub-controllers of the current root controller to find the sub-controller we need forVcinch(Self.window?). Rootviewcontroller?. Childviewcontrollers)! { //the mainnavigationcontroller here is my custom navigation controller. ifVc.iskind (of:MainNavigationController.self) { forVc1inchVc.childviewcontrollers {//If you are adding a bank card interface and withdrawal page prohibit the use of a third-party keyboard ifVc1.iskind (of:AddBBankCardController.self) | |Vc1.iskind (of:WithdrawViewController.self) {return false } } } } return true }
About the system comes with the numeric keypad cannot enter the decimal point problem how to resolve please see my other article: iOS custom numeric keypad
iOS designated page disables third-party keyboards, using the system's keyboard