Class

MPMediaPickerController

A specialized view controller that provides a graphical interface for selecting media items.

Overview

An MPMediaPickerController object, or media item picker, is a specialized view controller that you employ to provide a graphical interface for selecting media items. To display a media item picker, present it modally on an existing view controller. Presenting an MPMediaPickerController in non-modal mode; for example, pushing a MPMediaPickerController onto an existing UINavigationController stack will cause your app to crash. Media items are described in MPMediaItem.

To respond to user selections and to dismiss a media item picker, use the MPMediaPickerControllerDelegate protocol.

Symbols

Initializing a Media Item Picker

init(mediaTypes: MPMediaType)

Initializes a media item picker for specified media types.

Using a Media Item Picker

var allowsPickingMultipleItems: Bool

A Boolean value specifying the default selection behavior for a media item picker.

var showsCloudItems: Bool

A Boolean value specifying whether to display iCloud Media Library items for a media picker.

var delegate: MPMediaPickerControllerDelegate?

The delegate for a media item picker.

var mediaTypes: MPMediaType

The media types that media item picker presents.

var prompt: String?

A prompt, for the user, that appears above the navigation bar buttons.

var showsItemsWithProtectedAssets: Bool

A Boolean value specifying if protect assets are displayed.