<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/AttributeContainer/filter(runBoundaries:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "s:10Foundation18AttributeContainerV6filter13runBoundariesAcA16AttributedStringV0b3RunF0OSg_tF"
  },
  "title" : "filter(runBoundaries:)"
}
-->

# filter(runBoundaries:)

Returns a copy of the attribute container with only attributes that have the provided run boundaries.

```
func filter(runBoundaries: AttributedString.AttributeRunBoundaries?) -> AttributeContainer
```

## Parameters

`runBoundaries`

The required `runBoundaries` value of the filtered attributes. If `nil` is provided, only attributes not bound to any specific boundary will be returned.

## Return Value

A copy of the attribute container with only attributes whose `runBoundaries` property matches the provided value.

---

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)