init(_:including:)
Creates an attribute container from a dictionary and an attribute scope that a key path identifies.
Declaration
init<S>(_ dictionary: [NSAttributedString.Key : Any], including scope: KeyPath<AttributeScopes, S.Type>) throws where S : AttributeScopeParameters
- dictionary:
A dictionary of attribute keys and their values.
- scope:
A key path that identifies the attribute scope of the dictionary keys. This can be a nested scope that contains several scopes.
Discussion
This initializer only collects attributes from dictionary that exist in the provided scope. The resulting attribute container omits any keys in dictionary that don’t exist in scope.