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
offind
withreplace
optionssearch options
-
Sets line spacing - but actually replaces whole paragraph style
Declaration
Swift
func set(lineSpacing: CGFloat, paragraphSpacing: CGFloat? = nil)Parameters
lineSpacingspacing
-
Set alignment - actually replaces whole paragraph style
Declaration
Swift
func set(alignment: NSTextAlignment)Parameters
alignmentalignment
-
Updates a NSAttributedStringKey for a given range.
Declaration
Swift
func updateAttribute(_ name: NSAttributedString.Key, value: Any, range: NSRange? = nil)Parameters
valueAny type.
rangeA 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
rangeA 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
rangeA NSRange or nil to act on the whole string
NSMutableAttributedString Extension Reference