Contents

init(_:including:)

Creates a value-type attributed string from a reference type, including an attribute scope.

Declaration

init<S>(_ nsStr: NSAttributedString, including scope: S.Type) throws where S : AttributeScope

Parameters

  • nsStr:

    The Nsattributedstring to convert.

  • scope:

    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.

See Also

Creating an Attributed String from a Reference Type