MPMediaPickerController Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/MediaPlayer.framework |
| Availability | Available in iOS 3.0 and later. |
| Companion guide | |
| Declared in | MPMediaPickerController.h |
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. Media items are described in MPMediaItem Class Reference.
To respond to user selections and to dismiss a media item picker, use the MPMediaPickerControllerDelegate protocol as described in MPMediaPickerControllerDelegate Protocol Reference.
Tasks
Initializing a Media Item Picker
Using a Media Item Picker
-
allowsPickingMultipleItemsproperty -
showsCloudItemsproperty -
delegateproperty -
mediaTypesproperty -
promptproperty
Properties
allowsPickingMultipleItems
A Boolean value specifying multiple (YES) or single (NO) selection behavior for a media item picker.
Discussion
The default behavior for a media item picker is NO, which means that the picker allows selection of only a single media item. In this instance, the button for dismissing the picker is labeled “Cancel.”
When using the multiple-selection version, the button for dismissing the picker is labeled “Done.”
Availability
- Available in iOS 3.0 and later.
Declared In
MPMediaPickerController.hdelegate
The delegate for a media item picker.
Discussion
Typically, you set the delegate to be the same object that initializes and displays the media item picker. The delegate protocol is described in MPMediaPickerControllerDelegate Protocol Reference.
Availability
- Available in iOS 3.0 and later.
Declared In
MPMediaPickerController.hmediaTypes
The media types that media item picker presents.
Discussion
The available media types are listed in the Media Item Type Flags enumeration.
Availability
- Available in iOS 3.0 and later.
Declared In
MPMediaPickerController.hprompt
A prompt, for the user, that appears above the navigation bar buttons.
Availability
- Available in iOS 3.0 and later.
Declared In
MPMediaPickerController.hshowsCloudItems
A Boolean value specifying whether to display iCloud items (YES) or not (NO) for a media picker.
Discussion
The default behavior for a media item picker is YES, which means the the picker shows available iCloud items. A media item is considered an iCloud item if it is available via iTunes Match and is not already stored on the device.
Availability
- Available in iOS 6.0 and later.
Declared In
MPMediaPickerController.hInstance Methods
init
Initializes a media item picker for all media types.
Discussion
The default media type for a media item picker is MPMediaTypeAny.
Availability
- Available in iOS 3.0 and later.
See Also
Declared In
MPMediaPickerController.hinitWithMediaTypes:
Initializes a media item picker for specified media types.
Parameters
- mediaTypes
An integer representing the media types for the media item picker. See the
Media Item Type Flagsenumeration.
Availability
- Available in iOS 3.0 and later.
See Also
Declared In
MPMediaPickerController.h© 2012 Apple Inc. All Rights Reserved. (Last updated: 2012-09-19)