Instance MethodFoundationEssentials
mergingAttributes(_:mergePolicy:)
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
Returns an attributed string by merging the attributed string’s attributes with those in a specified attribute container.
func mergingAttributes(_ attributes: AttributeContainer, mergePolicy: AttributedString.AttributeMergePolicy = .keepNew) -> AttributedString
Parameters
attributesThe attribute container with the attributes to merge.
mergePolicyA policy to use when resolving conflicts between this string’s attributes and those in
attributes.