FrameResolver

public class FrameResolver

This class resolves text frames by using a typesetter object.

  • The typesetter to use for resolving frames.

    Declaration

    Swift

    public var typesetter: Typesetter!
  • A rectangle that specifies the frame bounds. Its default value is an infinite rectangle at zero origin.

    Declaration

    Swift

    public var frameBounds: CGRect
  • A boolean value that indicates whether or not to tightly fit the lines horizontally in a frame. If enabled, the resulting frame will have a minimum width that tightly encloses all the lines of specified text. Its default value is false.

    Declaration

    Swift

    public var fitsHorizontally: Bool
  • A boolean value that indicates whether or not to tightly fit the lines vertically in a frame. If enabled, the resulting frame will have a minimum height that tightly encloses all the lines of specified text. Its default value is false.

    Declaration

    Swift

    public var fitsVertically: Bool
  • The text alignment to apply on each line of a frame. Its default value is .leading.

    Declaration

    Swift

    public var textAlignment: TextAlignment
  • The vertical alignment to apply on the contents of a frame. Its default value is .top.

    Declaration

    Swift

    public var verticalAlignment: VerticalAlignment
  • The truncation mode to apply on the last line of a frame in case of overflow. Its default value is .line.

    Declaration

    Swift

    public var truncationMode: BreakMode
  • The truncation place for the last line of a frame. The truncation is disabled if its value is nil.

    Declaration

    Swift

    public var truncationPlace: TruncationPlace?
  • A boolean value that indicates whether or not to justify the lines in a frame. Its default value is false.

    Declaration

    Swift

    public var isJustificationEnabled: Bool
  • The justification level which can range from 0.0 to 1.0. A lower value increases the tightness between words while a higher value decreases it. Its default value is 1.0.

    Declaration

    Swift

    public var justificationLevel: CGFloat
  • The maximum number of lines that a frame should consist of.

    Declaration

    Swift

    public var maxLines: Int?
  • The extra spacing to add after each line of a frame. It is resolved before line height multiplier. Its default value is zero.

    Declaration

    Swift

    public var extraLineSpacing: CGFloat
  • The height multiplier to apply on each line of a frame. It is resolved after extra line spacing. Its default value is one.

    Declaration

    Swift

    public var lineHeightMultiplier: CGFloat
  • Creates a frame representing the specified UTF-16 range in source string.

    The resolver keeps on filling the frame until it either runs out of text or it finds that text no longer fits in frame bounds. The resulting frame consists of at least one line even if frame bounds are smaller.

    Declaration

    Swift

    public func makeFrame(codeUnitRange: Range<Int>) -> ComposedFrame?

    Parameters

    codeUnitRange

    The UTF-16 range of the frame in source string.

    Return Value

    A new composed frame.

  • Creates a frame representing the specified character range in source string.

    The resolver keeps on filling the frame until it either runs out of text or it finds that text no longer fits in frame bounds. The resulting frame consists of at least one line even if frame bounds are smaller.

    Declaration

    Swift

    public func makeFrame(characterRange: Range<String.Index>) -> ComposedFrame?

    Parameters

    characterRange

    The character range of the frame in source string.

    Return Value

    A new composed frame.