StringAttributes

public extension StringAttributes

Undocumented

  • Create a dictionary with NSAttributedString.Key

    Declaration

    Swift

    init(_ attributes: () -> [AttributedStringKey : Any])

    Parameters

    attributes

    A trailing closure that accepts a dictionary with NSAttributedString.Key

  • Create a dictionary with one NSAttributedString.Key

    Declaration

    Swift

    init(for key: AttributedStringKey, value: Any)

    Parameters

    for

    A NSAttributedString.Key for the String

    value

    The value for the attribute being modifed

  • Add an AttributedStringKey with a value of type Any to the dictionary

    Declaration

    Swift

    @discardableResult
    mutating func add(key: AttributedStringKey, value: Any) -> StringAttributes

    Parameters

    key

    A NSAttributedString.Key for the String

    value

    The value for the attribute being modifed