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.

  • Initializes and returns a newly allocated SOSMaskedTextField object with the specified frame rectangle.

    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.

    Declaration

    Objective-C

    - (id)initWithFrame:(CGRect)aRect;

    Swift

    init!(frame aRect: CGRect)

    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.

  • Initializes and returns a newly allocated SOSMaskedTextField object with the specified frame rectangle, maskPattern and borderColor.

    @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.

    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

    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 UIColor that will create a border color around your SOSMaskedTextView. This is a highlight to the maskPattern image that will hid the contents of the SOSMaskedTextView. In the middle of the view will be a the word Hidden 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.

    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.