---
title: NSCompoundPredicate
framework: foundation
role: symbol
role_heading: Class
path: foundation/nscompoundpredicate
---

# NSCompoundPredicate

A specialized predicate that evaluates logical combinations of other predicates.

## Declaration

```swift
class NSCompoundPredicate
```

## Overview

Overview Use NSCompoundPredicate to create an AND or OR compound predicate of one or more other predicates, or the NOT of a single predicate. For the logical AND and OR operations: An AND predicate with no subpredicates evaluates to true. An OR predicate with no subpredicates evaluates to false. A compound predicate with one or more subpredicates evaluates to the truth of its subpredicates.

## Topics

### Creating Compound Predicates

- [init(andPredicateWithSubpredicates:)](foundation/nscompoundpredicate/init(andpredicatewithsubpredicates:).md)
- [init(notPredicateWithSubpredicate:)](foundation/nscompoundpredicate/init(notpredicatewithsubpredicate:).md)
- [init(orPredicateWithSubpredicates:)](foundation/nscompoundpredicate/init(orpredicatewithsubpredicates:).md)
- [init(type:subpredicates:)](foundation/nscompoundpredicate/init(type:subpredicates:).md)
- [init(coder:)](foundation/nscompoundpredicate/init(coder:).md)

### Getting Information About a Compound Predicate

- [compoundPredicateType](foundation/nscompoundpredicate/compoundpredicatetype.md)
- [subpredicates](foundation/nscompoundpredicate/subpredicates.md)
- [NSCompoundPredicate.LogicalType](foundation/nscompoundpredicate/logicaltype.md)

## Relationships

### Inherits From

- [NSPredicate](foundation/nspredicate.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Filltering

- [Predicate](foundation/predicate.md)
- [PredicateError](foundation/predicateerror.md)
- [PredicateCodableConfiguration](foundation/predicatecodableconfiguration.md)
- [PredicateCodableKeyPathProviding](foundation/predicatecodablekeypathproviding.md)
- [PredicateExpression](foundation/predicateexpression.md)
- [StandardPredicateExpression](foundation/standardpredicateexpression.md)
- [PredicateExpressions](foundation/predicateexpressions.md)
- [PredicateBindings](foundation/predicatebindings.md)
- [NSPredicate](foundation/nspredicate.md)
- [NSExpression](foundation/nsexpression.md)
- [NSComparisonPredicate](foundation/nscomparisonpredicate.md)
