VGSLabel

@MainActor
public final class VGSLabel : UIView, VGSLabelProtocol

A view that displays revealed text data.

Enums

Delegates

Public interface

  • Add transformation regex to format raw revealed text.

    Declaration

    Swift

    @MainActor
    public func addTransformationRegex(_ regex: NSRegularExpression, template: String)

    Parameters

    regex

    NSRegularExpression object, transformation regex.

    template

    String object, template for replacement.

  • Name that will be associated with VGSLabel and used as a decoding contentPath on request response with revealed data from your organization vault.

    Declaration

    Swift

    @MainActor
    public var contentPath: String! { get set }
  • A Boolean value indicating whether VGSLabel string is empty.

    Declaration

    Swift

    @MainActor
    public var isEmpty: Bool { get }
  • Revealed text length.

    Declaration

    Swift

    @MainActor
    public var revealedRawTextLength: Int { get }
  • Placeholder text.

    Declaration

    Swift

    @MainActor
    public var placeholder: String? { get set }
  • Placeholder text styles.

    Declaration

    Swift

    @MainActor
    public var placeholderStyle: VGSPlaceholderLabelStyle { get set }
  • Bool flag. Apply secure mask if true. If secure range is not defined mask all text. Default is false.

    Declaration

    Swift

    @MainActor
    public var isSecureText: Bool { get set }
  • Text Symbol that will replace visible label text character when securing String. Should be one charcter only.

    Declaration

    Swift

    @MainActor
    public var secureTextSymbol: String { get set }
  • Clear last revealed text and set it to nil. IMPORTANT! New request is required to populate label with revealed data.

    Declaration

    Swift

    @MainActor
    public func clearText()
  • Copy text to pasteboard with format.

    Declaration

    Swift

    @MainActor
    public func copyTextToClipboard(format: CopyTextFormat = .raw)

    Parameters

    format

    VGSLabel.CopyTextFormat object, text format to copy. Default is .raw.

  • Set text range to be replaced with VGSLabel.secureTextSymbol.

    Declaration

    Swift

    @MainActor
    public func setSecureText(start: Int? = nil, end: Int? = nil)

    Parameters

    start

    Int object. Defines range start, should be less or equal to end and string length. Default is nil.

    end

    Int object. Defines range end, should be greater or equal to end and string length. Default is nil.

  • Set array of text ranges to be replaced with VGSLabel.secureTextSymbol.

    Declaration

    Swift

    @MainActor
    public func setSecureText(ranges: [VGSTextRange])

    Parameters

    ranges

    [VGSTextRange] object, an array of VGSTextRange objects to be applied subsequently.

UI Attribute

  • UIEdgeInsets for text. IMPORTANT! Paddings should be non-negative.

    Declaration

    Swift

    @MainActor
    public var paddings: UIEdgeInsets { get set }
  • UIEdgeInsets for placeholder. Default is nil. If placeholder paddings not set, paddings property will be used to control placeholder insets. IMPORTANT! Paddings should be non-negative.

    Declaration

    Swift

    @MainActor
    public var placeholderPaddings: UIEdgeInsets? { get set }
  • The natural size for the Lbel, considering only properties of the view itself.

    Declaration

    Swift

    @MainActor
    public override var intrinsicContentSize: CGSize { get }

Accessibility Attributes

  • A succinct label in a localized string that identifies the accessibility element.

    Declaration

    Swift

    @MainActor
    public var vgsAccessibilityLabel: String? { get set }
  • A localized string that contains a brief description of the result of performing an action on the accessibility element.

    Declaration

    Swift

    @MainActor
    public var vgsAccessibilityHint: String? { get set }
  • Boolean value that determinates if the text field should be exposed as an accesibility element.

    Declaration

    Swift

    @MainActor
    public var vgsIsAccessibilityElement: Bool { get set }

Font Attributes

  • Indicates whether VGSLabel should automatically update its font when the device’s UIContentSizeCategory is changed. It only works automatically with dynamic fonts

    Declaration

    Swift

    @MainActor
    public var vgsAdjustsFontForContentSizeCategory: Bool { get set }
  • VGSLabel text font. By default use default dynamic font style .body to update its size automatically when the device’s UIContentSizeCategory changed.

    Declaration

    Swift

    @MainActor
    public var font: UIFont? { get set }
  • Number of lines.

    Declaration

    Swift

    @MainActor
    public var numberOfLines: Int { get set }
  • VGSLabel text color.

    Declaration

    Swift

    @MainActor
    public var textColor: UIColor? { get set }
  • VGSLabel text alignment.

    Declaration

    Swift

    @MainActor
    public var textAlignment: NSTextAlignment { get set }
  • VGSLabel line break mode.

    Declaration

    Swift

    @MainActor
    public var lineBreakMode: NSLineBreakMode { get set }
  • VGSLabel layer corner radius.

    Declaration

    Swift

    @MainActor
    public var cornerRadius: CGFloat { get set }
  • VGSLabel layer borderWidth.

    Declaration

    Swift

    @MainActor
    public var borderWidth: CGFloat { get set }
  • VGSLabel layer borderColor.

    Declaration

    Swift

    @MainActor
    public var borderColor: UIColor? { get set }

Custom text styles