InitializerFoundationEssentials
init(_:attributes:)
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
Creates an attributed string from a character sequence and an attribute container.
init<S>(_ elements: S, attributes: AttributeContainer = .init()) where S : Sequence, S.Element == Character
Parameters
elementsA character sequence that provides the textual content for the attributed string.
attributesAttributes to apply to the textual content.