iOS designated page disables third-party keyboards, using the system's keyboard

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.