Instance SubscriptFoundationEssentials
subscript(dynamicMember:)
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
Returns an attribute value that a key path indicates.
@preconcurrency subscript<K>(dynamicMember keyPath: KeyPath<AttributeDynamicLookup, K>) -> K.Value? where K : AttributedStringKey, K.Value : Sendable { get set }
Overview
Returns nil unless the specified attribute exists and is present and identical for the entire string or substring. Use runs to find portions with consistent attributes.