Enumeration
AttributeScopes
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
Collections of attributes that system frameworks define.
@frozen enum AttributeScopes
Overview
Attribute scopes define groups of attributes appropriate for use with attributed strings in a certain domain. Attribute definitions contain a name, value type, and encode/decode methods to support serialization.
For example, the AttributeScopes.FoundationAttributes scope provides an attribute type for a link to a URL, AttributeScopes.FoundationAttributes.LinkAttribute, along with a property to access this type, link. Because AttributeScopes.FoundationAttributes implements AttributeDynamicLookup, you can access the link attribute by name, as this example shows:
var attrStr = AttributedString("Example site")
attrStr.link = URL(string: "http://example.com")
Topics
Structures
struct FoundationAttributesAttribute scopes that Foundation defines.
Instance Properties
var foundation: AttributeScopes.FoundationAttributes.TypeA property for accessing the attribute scopes that Foundation defines.
Relationships
Conforms To
Swift.BitwiseCopyable