Contents

subscript(dynamicMember:)

Returns a modified attribute container as part of building a chain of attributes.

Declaration

subscript<K>(dynamicMember keyPath: KeyPath<AttributeDynamicLookup, K>) -> AttributeContainer.Builder<K> where K : AttributedStringKey { get }

Discussion

This method returns an AttributeContainer.Builder, which allows you to chain multiple attributes in a single call, like this:

// An attribute container with the link and backgroundColor attributes.
let myContainer = AttributeContainer().link(myURL).backgroundColor(.yellow)

See Also

Accessing Attributes