SOSMaskedTextField Class Reference
Inherits from | UITextField |
---|---|
Conforms to | SOSMaskable |
Declared in | SOSMaskedTextField.h |
Overview
Custom UITextField that auto-masks itself when screen sharing is enabled during an SOS session.
Otherwise identical to the default UITextField
.
– initWithFrame:
Initializes and returns a newly allocated SOSMaskedTextField
object with the specified frame rectangle.
- (id)initWithFrame:(CGRect)aRect
Parameters
aRect |
The frame rectangle for the view, measured in points. The origin of the frame is relative to the superview in which you plan to add it. This method uses the frame rectangle to set the center and bounds properties accordingly. |
---|
Return Value
An initialized SOSMaskedTextField
object or nil if the object couldn’t be created.
Discussion
Note: Create a SOSMaskedTextField
in the given frame. This UIElement will be masked when the screen is shared
with the agent view. When the user touches a SOSMaskedTextField
while their screen is being shared, the
mask will be removed and the screen will not be shared while the masked is removed.
Note: If you used Interface Builder to design your interface, this method is not called when your view objects are loaded from
the nib file. To add a SOSMaskedTextField
in your nib just change the class of the UITextField
to SOSMaskedTextField
.
Declared In
SOSMaskedTextField.h
– initWithFrame:maskPattern:borderColor:text:textColor:
Initializes and returns a newly allocated SOSMaskedTextField
object with the specified frame rectangle, maskPattern
and borderColor.
- (id)initWithFrame:(CGRect)aRect maskPattern:(NSString *)maskPattern borderColor:(UIColor *)borderColor text:(NSString *)text textColor:(UIColor *)textColor
Parameters
aRect |
The frame rectangle for the view, measured in points. The origin of the frame is relative to the superview in which you plan to add it. This method uses the frame rectangle to set the center and bounds properties accordingly. |
---|---|
maskPattern |
The file name for the mask color that will be created for the view. The image will to be used to create a UIColor using colorWithPatternImage:. If the value is nil the default mask pattern will be used. |
borderColor |
A |
text |
The text that will be displayed in the middle of the masked text field. If this text needs to be localized ensure a localize string is passed in to this variable. If this variable is set to nil the default localized value of “Hidden” will be passed in. |
textColor |
The color of the text in the middle of the masked text field. If this variable is set to nil the default color will be white. |
Return Value
An initialized SOSMaskedTextField
object or nil if the object couldn’t be created.
Discussion
Create a SOSMaskedTextField
in the given frame with a custom masked image string, borderColor, text, and textColor.
The UIElement will be masked when the screen is shared with the agent view. When the user touches a SOSMaskedTextField
while
their screen is being shared, the mask will be removed and the screen will not be shared while the masked is removed.
If you used Interface Builder to design your interface, this method is not called when your view objects are loaded from
the nib file. To add a SOSMaskedTextField
in your nib just change the class of the UITextField to SOSMaskedTextField
.
Setting the MaskPattern, BorderColor, Text, and TextColor will adjust the look of the mask, this can be done to adjust the mask to the look and feel of the app. If you are using Interface Builder add following RunTime Attributes in the nib Identity Inspector maskingPattern, borderColor, maskText, and maskTextColor.
Declared In
SOSMaskedTextField.h