---
title: predicate
framework: photos
role: symbol
role_heading: Instance Property
path: photos/phfetchoptions/predicate
---

# predicate

A predicate that specifies which properties to select results by and that also specifies any constraints on selection.

## Declaration

```swift
var predicate: NSPredicate? { get set }
```

## Discussion

Discussion Construct a predicate with the properties of the class of objects that you want to fetch, listed in the PHFetchOptions table. For example, the following code uses a predicate to fetch assets matching a specific set of mediaSubtypes values. Photos does not support predicates created with the NSPredicate method init or the predicateWithBlock method.

## See Also

### Sorting and Filtering Fetch Results

- [sortDescriptors](photos/phfetchoptions/sortdescriptors.md)
