---
title: MPMediaPredicate
framework: mediaplayer
role: symbol
role_heading: Class
path: mediaplayer/mpmediapredicate
---

# MPMediaPredicate

An abstract class that defines classes for filtering media in a media query.

## Declaration

```swift
class MPMediaPredicate
```

## Overview

Overview In media queries, a predicate is a statement of a logical condition that you want to test each media item against. The system returns the media items that satisfy the condition in the query result. Use this class’s concrete subclass, described in MPMediaPropertyPredicate, to define the filter in a media query to retrieve a subset of media items from the library. For more information about media queries, see MPMediaQuery.

## Topics

### Initializers

- [init(coder:)](mediaplayer/mpmediapredicate/init(coder:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Inherited By

- [MPMediaPropertyPredicate](mediaplayer/mpmediapropertypredicate.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)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)

## See Also

### Media item queries

- [Using filters to create specialized queries](mediaplayer/using-filters-to-create-specialized-queries.md)
- [MPMediaQuery](mediaplayer/mpmediaquery.md)
- [MPMediaQuerySection](mediaplayer/mpmediaquerysection.md)
- [MPMediaPropertyPredicate](mediaplayer/mpmediapropertypredicate.md)
