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
attributesThe existing attributes to replace.
othersThe new attributes to apply.