NSMutableAttributedString

public extension NSMutableAttributedString
  • Undocumented

    Declaration

    Swift

    var fullRange: NSRange { get }
  • Undocumented

    Declaration

    Swift

    convenience init(string: String, link: String?)
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func set(link: String, forText textToFind: String? = nil) -> Bool
  • Undocumented

    Declaration

    Swift

    @discardableResult
    func set(font: FontCompat, forText textToFind: String? = nil) -> Bool
  • Replace substrings

    Declaration

    Swift

    func replaceOccurrences(of: String, with: String, options: NSString.CompareOptions = [.literal])

    Parameters

    of

    find

    with

    replace

    options

    search options

  • Sets line spacing - but actually replaces whole paragraph style

    Declaration

    Swift

    func set(lineSpacing: CGFloat, paragraphSpacing: CGFloat? = nil)

    Parameters

    lineSpacing

    spacing

  • Set alignment - actually replaces whole paragraph style

    Declaration

    Swift

    func set(alignment: NSTextAlignment)

    Parameters

    alignment

    alignment

  • Updates a NSAttributedStringKey for a given range.

    Declaration

    Swift

    func updateAttribute(_ name: NSAttributedString.Key, value: Any, range: NSRange? = nil)

    Parameters

    value

    Any type.

    range

    A NSRange or nil to act on the whole string

  • Updates a Dictionary of NSAttributedStringKeys for a given range.

    Declaration

    Swift

    func updateAttributes(_ attrs: [NSAttributedString.Key : Any], range: NSRange? = nil)

    Parameters

    range

    A NSRange or nil to act on the whole string

  • Removes a Dictionary of NSAttributedStringKeys for a given range.

    Declaration

    Swift

    func removeAttributes(_ attrs: [NSAttributedString.Key], range: NSRange? = nil)

    Parameters

    range

    A NSRange or nil to act on the whole string