SOSMaskedTextField
@interface SOSMaskedTextField : UITextField <SOSMaskable>
Custom UITextField that auto-masks itself when screen sharing is enabled during an SOS session.
Otherwise identical to the default UITextField.
See
SOSMaskable
-
Initializes and returns a newly allocated
SOSMaskedTextFieldobject with the specified frame rectangle.Note
Create a
SOSMaskedTextFieldin the given frame. This UIElement will be masked when the screen is shared with the agent view. When the user touches aSOSMaskedTextFieldwhile 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
SOSMaskedTextFieldin your nib just change the class of theUITextFieldtoSOSMaskedTextField.Declaration
Objective-C
- (id)initWithFrame:(CGRect)aRect;Swift
init!(frame aRect: CGRect)Parameters
aRectThe 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
SOSMaskedTextFieldobject or nil if the object couldn’t be created. -
Initializes and returns a newly allocated
SOSMaskedTextFieldobject with the specified frame rectangle, maskPattern and borderColor.@discussion Create a
SOSMaskedTextFieldin 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 aSOSMaskedTextFieldwhile 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
SOSMaskedTextFieldin your nib just change the class of the UITextField toSOSMaskedTextField.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.
Declaration
Objective-C
- (id)initWithFrame:(CGRect)aRect maskPattern:(NSString *)maskPattern borderColor:(UIColor *)borderColor text:(NSString *)text textColor:(UIColor *)textColor;Swift
init!(frame aRect: CGRect, maskPattern: String!, borderColor: UIColor!, text: String!, textColor: UIColor!)Parameters
aRectThe 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.
maskPatternThe 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.
borderColorA
UIColorthat will create a border color around yourSOSMaskedTextView. This is a highlight to the maskPattern image that will hid the contents of theSOSMaskedTextView. In the middle of the view will be a the wordHidden
the back ground of this image will also be changed with the border color. If the value is nil the default mask pattern will be used.textThe 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.textColorThe 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
SOSMaskedTextFieldobject or nil if the object couldn’t be created.
Install in Dash
SOSMaskedTextField Class Reference