By setting the UITextView or UITextField property from Secure Text Entry to YES , custom keyboards will not be displayed by default and cannot be switched either.
It is also, unfortunately, to hide information about a keystroke, as well as drag and drop automatic caps and automatically correct and sketch suggestions. Therefore, you should switch back to NO after you have forced the user to use the Apple keyboard.
Switching this property and then turning it off may cause the Apple Keyboard to become the first key that appears by default.
NOW, the user can still press the global key so that you have two options:
• First, you can simply enable them and determine if they are using [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(inputModeDidChange:) name:@"UITextInputCurrentInputModeDidChangeNotification" object:nil]; and just override the secureTextEntry code above and force switch to the default Apple keyboard (unprofessional method, but very easy to program). (* Note! This will also prevent users from using the dictation keyboard (by clicking the microphone icon button next to the space bar) unless you use undocumented code to determine if it is dictation or not (which exists and presumably passed the Apple Validation on multiple accounts . Information about this can be found here )
Or
• Two: use UIWindows to get the default ONTOP keyboard and add a UIWindow with userInteractionEnabled set to YES covering the location of this key (this will require several conditional statements to make sure that you close the rights) change the keyboard "for every opportunity . (e.g. iPhone4 landscape keyboard, iPhone5 portable keyboard, etc.).
Here is some demo code, although it works for portrait keyboards (iphone5 and iphone4)
:
viewController.h
#import <UIKit/UIKit.h> @interface ViewController : UIViewController <UITextFieldDelegate> { UITextField *theTextField; UIWindow *statusWindow; } @end
:
viewController.m
:
Here is an example of how this code will look ... I used a custom keyboard when I launched an application that forced me to an Apple keyboard, and then put a red square on the “change keyboard” button, which made me unable to click on the button, to change the keyboard. (The red square can be changed to be anything, for example, a blank key or a globe icon in a faded (disconnected) state.)

Albert ranshaw
source share