init(_:including:)
Creates a value-type attributed string from a reference type, including an attribute scope that a key path identifies.
Declaration
init<S>(_ nsStr: NSAttributedString, including scope: KeyPath<AttributeScopes, S.Type>) throws where S : AttributeScopeParameters
- nsStr:
The Nsattributedstring to convert.
- scope:
A key path that identifies the attribute scope of the attributes in
nsStr. This can be a nested scope that contains several scopes.
Discussion
This initializer only collects attributes from nsStr that exist in the provided scope. The resulting attributed string omits any keys in nsStr that don’t exist in scope.