---
title: "filtered(using:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsorderedset/filtered(using:)"
---

# filtered(using:)

Evaluates a given predicate against each object in the receiving ordered set and returns a new ordered set containing the objects for which the predicate returns true.

## Declaration

```swift
func filtered(using p: NSPredicate) -> NSOrderedSet
```

## Parameters

- `p`: The predicate against which to evaluate the receiving ordered set’s elements.

## Return Value

Return Value A new ordered set containing the objects in the receiving ordered set for which p returns true.

## Discussion

Discussion For more details, see Predicate Programming Guide.
