<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSAttributedString/init(_:including:)-9gogq",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:So18NSAttributedStringC10FoundationE_9includingAbC010AttributedB0V_xmtKcAC14AttributeScopeRzlufc"
  },
  "title" : "init(_:including:)"
}
-->

# init(_:including:)

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

```
convenience init<S>(_ attrStr: AttributedString, including scope: S.Type) throws where S : AttributeScope
```

## Parameters

`attrStr`

The value-type attributed string that provides the text and attributes of the new object.

`scope`

The attribute scope of the attributes in `attrStr`. This can be a nested scope that contains several scopes.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)