Skip to content

Instance MethodFoundationEssentials

replacingAttributes(_:with:)

iOS 15.0+ iPadOS 15.0+ Mac Catalyst 15.0+ macOS 12.0+ tvOS 15.0+ watchOS 8.0+
Returns an attributed string by replacing occurrences of attributes in one attribute container with those in another attribute container.
func replacingAttributes(_ attributes: AttributeContainer, with others: AttributeContainer) -> AttributedString

Parameters

attributes

The existing attributes to replace.

others

The new attributes to apply.