Files
Pulse/Sources/PulseUI/Extensions/NSAttributedString+Extensions.swift
2024-07-14 13:40:50 -04:00

16 lines
484 B
Swift

// The MIT License (MIT)
//
// Copyright (c) 2020-2024 Alexander Grebenyuk (github.com/kean).
import Foundation
extension NSMutableAttributedString {
func append(_ string: String, _ attributes: [NSAttributedString.Key: Any] = [:]) {
append(NSAttributedString(string: string, attributes: attributes))
}
func addAttributes(_ attributes: [NSAttributedString.Key: Any]) {
addAttributes(attributes, range: NSRange(location: 0, length: string.count))
}
}