SLKeyboard Protocol Reference
Conforms to | NSObject |
Declared in | SLKeyboard.h |
Overview
The SLKeyboard
protocol declares a standard way to interact with your application’s
input views, such as the standard keyboard (the SLKeyboard
class) as well as
(in iOS 7 and above) custom input views subclassing
UIInputView
.
Conforming classes must override keyboard
, to vend instances,
and typeString:
, to enter strings via instances' associated custom UIInputView
s.
Tasks
-
+ keyboard
Returns an element representing an instance of this input view.
required method -
– typeString:
Taps the keys of the specified input view as required to generate the specified string.
required method -
– hide
Tap the keyboard’s “Hide Keyboard” button to hide the keyboard without executing any done/submit actions.
-
– typeString:withSetValueFallbackUsingElement:
Uses
typeString:
to tap the keys of the input string on the receiver; if that method throws an exception, this method will then send thesetValue
JavaScript message to the input element as a fallback.
Instance Methods
hide
Tap the keyboard’s “Hide Keyboard” button to hide the keyboard without executing any done/submit actions.
- (void)hide
Declared In
SLKeyboard.h
typeString:
Taps the keys of the specified input view as required to generate the specified string.
- (void)typeString:(NSString *)string
Parameters
- string
The string to be typed using the input view.
Exceptions
- NSGenericException
This method should throw an exception of some type if string contains any characters that cannot be typed using this input view. If this method might throw an exception, the conforming class should also implement
typeString:withSetValueFallbackUsingElement:
.
Declared In
SLKeyboard.h
typeString:withSetValueFallbackUsingElement:
Uses typeString:
to tap the keys of the input string on the
receiver; if that method throws an exception, this method will then
send the setValue
JavaScript message to the input element as a fallback.
- (void)typeString:(NSString *)string withSetValueFallbackUsingElement:(SLUIAElement *)element
Parameters
- string
The string to be typed on the keyboard or set as the value for element.
- element
The user interface element on which the
setValue
JavaScript method will be called if the internal call totypeString:
throws an exception.
Discussion
Implementing this method allows SLTextField
, SLTextView
, and related classes
to work around an input view’s lack of support for certain characters.
Declared In
SLKeyboard.h