Contents

init(_:including:)

Creates an attribute container from a dictionary and an attribute scope.

Declaration

init<S>(_ dictionary: [NSAttributedString.Key : Any], including scope: S.Type) throws where S : AttributeScope

Parameters

  • dictionary:

    A dictionary of attribute keys and their values.

  • scope:

    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.

See Also

Creating an Attribute Container