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

# filtered(using:)

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

## Declaration

```swift
func filtered(using predicate: NSPredicate) -> [Any]
```

## Parameters

- `predicate`: The predicate against which to evaluate the receiving array’s elements.

## Return Value

Return Value A new array containing the objects in the receiving array for which predicate returns true. Objects in the resulting array appear in the same order as they do in the receiver.

## Discussion

Discussion For more details, see Predicate Programming Guide.

## See Also

### Deriving New Arrays

- [adding(_:)](foundation/nsarray/adding(_:).md)
- [addingObjects(from:)](foundation/nsarray/addingobjects(from:).md)
- [subarray(with:)](foundation/nsarray/subarray(with:).md)
