TextProtocol

public protocol TextProtocol : View

Undocumented

  • text(_:) Default implementation

    Undocumented

    Default Implementation

    set content of the Text

    Declaration

    Swift

    func text(_ value: @autoclosure @escaping () -> String?) -> Self
  • attributedText(_:) Default implementation

    Undocumented

    Default Implementation

    set the styled text that the label displays.

    Declaration

    Swift

    func attributedText(_ value: @autoclosure @escaping () -> NSAttributedString?) -> Self
  • font(name:style:size:range:) Default implementation

    Undocumented

    Default Implementation

    Set the font of the receiver’s text.

    // value of AKFontStyle
    public enum AKFontStyle{
        case `default`
        case bold
        case italic
        case bolditalic
    }
    

    Declaration

    Swift

    func font(name: @escaping @autoclosure () -> String?,
              style: @escaping @autoclosure () -> AKFontStyle,
              size: @escaping @autoclosure () -> CGFloat,
              range: @escaping @autoclosure () -> NSRange?)->Self
  • font(name:range:) Default implementation

    Undocumented

    Default Implementation

    change the font name of the receiver’s text

    Declaration

    Swift

    func font(name value: @escaping @autoclosure () -> String?,
              range: @escaping @autoclosure () -> NSRange?)->Self
  • font(size:range:) Default implementation

    Undocumented

    Default Implementation

    change the font size of the receiver’s text

    Declaration

    Swift

    func font(size value: @escaping @autoclosure () -> CGFloat,
              range: @escaping @autoclosure () -> NSRange?)->Self
  • font(style:range:) Default implementation

    Undocumented

    Default Implementation

    change the font style of the receiver’s text

    // value of AKFontStyle
    public enum AKFontStyle{
        case `default`
        case bold
        case italic
        case bolditalic
    }
    

    Declaration

    Swift

    func font(style value: @escaping @autoclosure () -> AKFontStyle,
              range: @escaping @autoclosure () -> NSRange?)->Self
  • textColor(_:range:) Default implementation

    Undocumented

    Default Implementation

    change the color of the text

    Declaration

    Swift

    func textColor(_ value:@escaping @autoclosure () -> UIColor,
                   range: @escaping @autoclosure () -> NSRange?)->Self
  • Undocumented

    Default Implementation

    change the rgba-color of the text.

    Declaration

    Swift

    func textColor(red r:@escaping @autoclosure () -> Int,
                   green g :@escaping @autoclosure () -> Int,
                   blue b:@escaping @autoclosure () -> Int,
                   alpha a:@escaping @autoclosure () -> CGFloat,
                   range: @escaping @autoclosure () -> NSRange?)->Self
  • textColor(hex:alpha:range:) Default implementation

    Undocumented

    Default Implementation

    change the rgba-color of the text

    Declaration

    Swift

    func textColor(hex:@escaping @autoclosure () -> Int,
                   alpha a:@escaping @autoclosure () -> Float,
                   range: @escaping @autoclosure () -> NSRange?)->Self
  • lineLimit(_:) Default implementation

    Undocumented

    Default Implementation

    Set the maximum number of lines for rendering text. 0 representing unlimited.

    Declaration

    Swift

    func lineLimit(_ value: @autoclosure @escaping () -> Int) -> Self
  • textAlign(_:range:) Default implementation

    Undocumented

    Default Implementation

    set the textAlign of the back UILabel object.

    public enum NSTextAlignment : Int {
        case left = 0 // Visually left aligned
        case center = 1 // Visually centered
        case right = 2 // Visually right aligned
        /* !TARGET_ABI_USES_IOS_VALUES */
        // Visually right aligned
        // Visually centered
        case justified = 3 // Fully-justified. The last line in a paragraph is natural-aligned.
        case natural = 4 // Indicates the default alignment for script
    }
    

    Declaration

    Swift

    func textAlign(_ value: @autoclosure @escaping () -> NSTextAlignment, range: @autoclosure @escaping () -> NSRange?) -> Self
  • lineSpacing(_:) Default implementation

    Undocumented

    Default Implementation

    The distance in points between the bottom of one line fragment and the top of the next.

    Declaration

    Swift

    func lineSpacing(_ value: @autoclosure @escaping () -> CGFloat) -> Self
  • breakMode(_:range:) Default implementation

    Undocumented

    Default Implementation

    The technique for wrapping and truncating the label’s text. Call lineBreakMode of the UILabel directly.

    public enum NSLineBreakMode : Int {
    
        case byWordWrapping = 0 // Wrap at word boundaries, default
    
        case byCharWrapping = 1 // Wrap at character boundaries
    
        case byClipping = 2 // Simply clip
    
        case byTruncatingHead = 3 // Truncate at head of line: "...wxyz"
    
        case byTruncatingTail = 4 // Truncate at tail of line: "abcd..."
    
        case byTruncatingMiddle = 5 // Truncate middle of line:  "ab...yz"
    }
    

    Declaration

    Swift

    func breakMode(_ value: @autoclosure @escaping () -> NSLineBreakMode, range: @autoclosure @escaping () -> NSRange?) -> Self
  • textShadow(_:range:) Default implementation

    Undocumented

    Default Implementation

    set the shadow, in points, for the text

    Declaration

    Swift

    func textShadow(_ value:@escaping @autoclosure () -> NSShadow,
                    range: @escaping @autoclosure () -> NSRange?)->Self
  • Undocumented

    Default Implementation

    set the shadow, in points, for the text

    Declaration

    Swift

    func textShadow(color:@escaping @autoclosure () ->UIColor,
                    offset:@escaping @autoclosure () ->CGSize,
                    blurRadius:@escaping @autoclosure () ->CGFloat,
                    range: @escaping @autoclosure () ->NSRange?)->Self
  • textShadowOffset(_:range:) Default implementation

    Undocumented

    Default Implementation

    set the shadow offset, in points, for the text

    Declaration

    Swift

    func textShadowOffset(_ value:@escaping @autoclosure () -> CGSize,
                          range: @escaping @autoclosure () -> NSRange?)->Self
  • textShadowColor(_:range:) Default implementation

    Undocumented

    Default Implementation

    set the shadow color for the text

    Declaration

    Swift

    func textShadowColor(_ value:@escaping @autoclosure () -> UIColor,
                         range: @escaping @autoclosure () -> NSRange?)->Self
  • Undocumented

    Default Implementation

    set the shadow color for the text, the color is generated by the rgba value.

    Declaration

    Swift

    func textShadowColor(red r:@escaping @autoclosure () -> Int,
                         green g :@escaping @autoclosure () -> Int,
                         blue b:@escaping @autoclosure () -> Int,
                         alpha a:@escaping @autoclosure () -> CGFloat,
                         range: @escaping @autoclosure () -> NSRange?)->Self
  • textShadowColor(hex:alpha:range:) Default implementation

    Undocumented

    Default Implementation

    set the shadow color for the text, the color is generated by the rgba value.

    Declaration

    Swift

    func textShadowColor(hex :@escaping @autoclosure () -> Int,
                         alpha a:@escaping @autoclosure () -> Float,
                         range: @escaping @autoclosure () -> NSRange?)->Self
  • textShadowBlurRadius(_:range:) Default implementation

    Undocumented

    Default Implementation

    set the shadow offset, in points, for the text

    Declaration

    Swift

    func textShadowBlurRadius(_ value:@escaping @autoclosure () -> CGFloat,
                              range: @escaping @autoclosure () -> NSRange?)->Self
  • highlightedTextColor(_:) Default implementation

    Undocumented

    Default Implementation

    set the highlight color for the text.

    Declaration

    Swift

    func highlightedTextColor(_ value: @autoclosure @escaping () -> UIColor?) -> Self
  • isHighlighted(_:) Default implementation

    Undocumented

    Default Implementation

    set a Boolean value that determines whether the label draws its text with a highlight.

    Declaration

    Swift

    func isHighlighted(_ value: @autoclosure @escaping () -> Bool) -> Self
  • userInteractionEnabled(_:) Default implementation

    Undocumented

    Default Implementation

    Set A Boolean value that determines whether the system ignores and removes user events for this label from the event queue.

    Declaration

    Swift

    func userInteractionEnabled(_ value: @autoclosure @escaping () -> Bool) -> Self
  • isEnabled(_:) Default implementation

    Undocumented

    Default Implementation

    set a Boolean value that determines whether the back label draws its text in an enabled state.

    Declaration

    Swift

    func isEnabled(_ value: @autoclosure @escaping () -> Bool) -> Self
  • adjustsFontSizeToFitWidth(_:) Default implementation

    Undocumented

    Default Implementation

    A Boolean value that determines whether the label reduces the text’s font size to fit the title string into the label’s bounding rectangle.

    Declaration

    Swift

    func adjustsFontSizeToFitWidth(_ value: @autoclosure @escaping () -> Bool) -> Self
  • baselineAdjustment(_:) Default implementation

    Undocumented

    Default Implementation

    An option that controls whether the text’s baseline remains fixed when text needs to shrink to fit in the label.

    public enum UIBaselineAdjustment : Int {
    
        case alignBaselines = 0 // default. used when shrinking text to position based on the original baseline
    
        case alignCenters = 1
    
        case none = 2
    }
    

    Declaration

    Swift

    func baselineAdjustment(_ value: @autoclosure @escaping () -> UIBaselineAdjustment) -> Self
  • minimumScaleFactor(_:) Default implementation

    Undocumented

    Default Implementation

    The minimum scale factor for the label’s text.

    Declaration

    Swift

    func minimumScaleFactor(_ value: @autoclosure @escaping () -> CGFloat) -> Self
  • Undocumented

    Default Implementation

    A Boolean value that determines whether the label tightens text before truncating.

    When the value of this property is true, the label tightens intercharacter spacing of its text before allowing any truncation to occur. The label determines the maximum amount of tightening automatically based on the font, current line width, line break mode, and other relevant information. This autoshrinking behavior is only intended for use with a single-line label. The default value of this property is false.

    Declaration

    Swift

    func allowsDefaultTighteningForTruncation(_ value: @autoclosure @escaping () -> Bool) -> Self
  • lineBreakStrategy(_:) Default implementation

    Undocumented

    Default Implementation

    A Boolean value that determines whether the label tightens text before truncating.

    When the value of this property is true, the label tightens intercharacter spacing of its text before allowing any truncation to occur. The label determines the maximum amount of tightening automatically based on the font, current line width, line break mode, and other relevant information. This autoshrinking behavior is only intended for use with a single-line label. The default value of this property is false.

    Declaration

    Swift

    func lineBreakStrategy(_ value: @autoclosure @escaping () -> NSParagraphStyle.LineBreakStrategy) -> Self
  • preferredMaxLayoutWidth(in:) Default implementation

    Undocumented

    Default Implementation

    The preferred maximum width, in points, for a multiline label.

    Declaration

    Swift

    func preferredMaxLayoutWidth(in value: @autoclosure @escaping () -> CGFloat) -> Self
  • kern(_:range:) Default implementation

    Undocumented

    Default Implementation

    A kerning adjustment. @discussion Default is standard kerning. The kerning attribute indicate how many points the following character should be shifted from its default offset as defined by the current character’s font in points; a positive kern indicates a shift farther along and a negative kern indicates a shift closer to the current character. If this attribute is not present, standard kerning will be used. If this attribute is set to 0.0, no kerning will be done at all. @discussion Set this property applies to the entire text string. Get this property returns the first character’s attribute.

    Declaration

    Swift

    func kern(_ value:@escaping @autoclosure () -> Float,
                     range: @escaping @autoclosure () -> NSRange?) -> Self
  • paragraphSpacing(_:range:) Default implementation

    Undocumented

    Default Implementation

    The space after the end of the paragraph (A wrapper for NSParagraphStyle).

    • end of the paragraph to separate it from the following paragraph. This value must
    • be nonnegative. The space between paragraphs is determined by adding the previous
    • paragraph’s paragraphSpacing and the current paragraph’s paragraphSpacingBefore.
    • Default is 0.
    • Set this property applies to the entire text string.

    Declaration

    Swift

    func paragraphSpacing(_ value: @escaping @autoclosure () -> CGFloat,
                                 range: @escaping @autoclosure () -> NSRange?) -> Self
  • paragraphSpacingBefore(_:range:) Default implementation

    Undocumented

    Default Implementation

    The distance between the paragraph’s top and the beginning of its text content. (A wrapper for NSParagraphStyle). (read-only)

    • Default is 0.
    • Get this property returns the first character’s attribute.

    Declaration

    Swift

    func paragraphSpacingBefore(_ value:@escaping @autoclosure () -> CGFloat,
                                       range: @escaping @autoclosure () -> NSRange?) -> Self
  • firstLineHeadIndent(_:range:) Default implementation

    Undocumented

    Default Implementation

    The indentation of the first line (A wrapper for NSParagraphStyle). (read-only)

    • Default is 0.

    Declaration

    Swift

    func firstLineHeadIndent(_ value: @escaping @autoclosure () -> CGFloat,
                             range: @escaping @autoclosure () -> NSRange?) -> Self
  • headIndent(_:range:) Default implementation

    Undocumented

    Default Implementation

    The indentation of the receiver’s lines other than the first. (A wrapper for NSParagraphStyle). (read-only)

    • of a text container to the beginning of lines other than the first. This value is
    • always nonnegative.
    • Default is 0.

    Declaration

    Swift

    func headIndent(_ value: @escaping @autoclosure () -> CGFloat,
                           range: @escaping @autoclosure () -> NSRange?) -> Self
  • tailIndent(_:range:) Default implementation

    Undocumented

    Default Implementation

    The trailing indentation (A wrapper for NSParagraphStyle). (read-only)

    • Default is 0.

    Declaration

    Swift

    func tailIndent(_ value: @escaping @autoclosure () -> CGFloat,
                           range: @escaping @autoclosure () -> NSRange?) -> Self
  • minimumLineHeight(_:range:) Default implementation

    Undocumented

    Default Implementation

    The receiver’s minimum height (A wrapper for NSParagraphStyle). (read-only)

    • the receiver will occupy, regardless of the font size or size of any attached graphic.
    • This value must be nonnegative.
    • Default is 0.

    Declaration

    Swift

    func minimumLineHeight(_ value: @escaping @autoclosure () -> CGFloat,
                                  range: @escaping @autoclosure () -> NSRange?) -> Self
  • maximumLineHeight(_:range:) Default implementation

    Undocumented

    Default Implementation

    The receiver’s maximum line height (A wrapper for NSParagraphStyle). (read-only)

    • the receiver will occupy, regardless of the font size or size of any attached graphic.
    • This value is always nonnegative. Glyphs and graphics exceeding this height will
    • overlap neighboring lines; however, a maximum height of 0 implies no line height limit.
    • Although this limit applies to the line itself, line spacing adds extra space between adjacent lines.
    • Default is 0 (no limit).

    Declaration

    Swift

    func maximumLineHeight(_ value: @escaping @autoclosure () -> CGFloat,
                                  range: @escaping @autoclosure () -> NSRange?) -> Self
  • font(_:range:) Extension method

    set the font of the receiver’s text.

    Declaration

    Swift

    @discardableResult
    public func font(_ value: @autoclosure @escaping () -> UIFont, range: @autoclosure @escaping () -> NSRange? = nil) -> Self

    Parameters

    value

    a UIFont value

    Return Value

    self