Text

public struct Text : TextProtocol

The View Representing of text,is implemented based on UILabel.

             Text("content..")
                 .font(size: 25)
                 .textColor(.white)
                 .lineLimit(0)
                 .lineSpacing(10)
                 .backgroundColor(.orange)
  • the node behind of Text

    Declaration

    Swift

    public var node: ArgoKitNode? { get }
  • initialize the Text with emptry

    Declaration

    Swift

    public init()
  • initialize the Text with a string

    Declaration

    Swift

    public init(_ text: @autoclosure @escaping () -> String?)

    Parameters

    text

    a string value

  • initialize the Text with a string

    Declaration

    Swift

    public init(attributedText: @autoclosure @escaping () -> NSAttributedString?)

    Parameters

    text

    a string value

  • Returns the drawing rectangle for the label’s text. call textRect of the back label object directly.

    Declaration

    Swift

    public func textRect(forBounds bounds: CGRect, limitedToNumberOfLines numberOfLines: Int) -> CGRect

    Parameters

    bounds

    The bounding rectangle of the label.

    numberOfLines

    The maximum number of lines to use for the label. The value 0 indicates the label has no maximum number of lines and the rectangle should encompass all of the text.

    Return Value

    self

  • Draws the label’s text, or its shadow, in the specified rectangle.

    Declaration

    Swift

    @discardableResult
    public func drawText(in rect: CGRect) -> Text

    Parameters

    rect

    The bounding rectangle of the label.

    Return Value

    self