NSRange

extension NSRange
  • init(textRange:in:) From Chord_Provider

    Convert a NSTextRange into a NSRange

    Declaration

    Swift

    init?(textRange: NSTextRange, in contentManager: NSTextContentManager)

    Parameters

    textRange

    The NSTextRange

    contentManager

    The NSTextContentManager

  • Convert a Range to a NSRange, optional skipping leading or trailing characters

    Declaration

    Swift

    init(
        range: Range<String.Index>,
        in string: String,
        leadingOffset: Int = 0,
        trailingOffset: Int = 0
    )

    Parameters

    range

    The Range

    string

    The string

    leadingOffset

    The leading offset

    trailingOffset

    The trailing offset