Reputation: 1541
How can I block keyboard for input (something like userInteractionEnabled = NO) in iOS >= 4 ?
Keyboard is used for TextEdit.
If I disable interaction for textedit then keyboard disappears, but I want to see the keyboard.
Upvotes: 1
Views: 955
Reputation: 2080
You can always disable userInteractionEnabled
on the keyboard view, or less-dangerously add an invisible subview to the keyboard that blocks interaction. See iOS: How to access the `UIKeyboard`? on how to get the UIView for the keyboard.
Upvotes: 0
Reputation: 991
have you tried this delegate?
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
Upvotes: 4
Reputation: 14304
Le Coeur, I think you need to consider a different approach to whatever you're trying to achieve by restricting the keyboard input for two good reasons:
A UIElement that engages the user to type but doesn't react to any of the user's gestures is sure to be rejected by Apple.
Because this keyboard is on the OS level, it is private API and I am pretty sure there is nothing you can do to the keyboard to block access to the keys.
Hope this helps
Upvotes: 1