Structure

PHAssetMediaSubtype

Constants identifying specific variations of asset media, such as panorama or screenshot photos and time lapse or high frame rate video.

Declaration

struct PHAssetMediaSubtype

Overview

You use these constants with the PHAsset and PHContentEditingInput classes to fetch specific types of assets or to identify an asset being edited.

Media subtypes are OptionSet values, so you can combine them using set literal syntax to test for multiple subtypes.

Topics

Initializers

init(rawValue: UInt)

Initializes a media subtype from a raw value.

Media Subtypes

static var photoPanorama: PHAssetMediaSubtype

The asset is a large-format panorama photo.

static var photoHDR: PHAssetMediaSubtype

The asset is a High Dynamic Range photo.

static var photoScreenshot: PHAssetMediaSubtype

The asset is an image captured with the device’s screenshot feature.

static var photoLive: PHAssetMediaSubtype

The asset is a Live Photo that includes movement and sounds from the moments just before and after its capture.

static var videoStreamed: PHAssetMediaSubtype

The asset is a video whose contents are always streamed over a network connection.

static var videoHighFrameRate: PHAssetMediaSubtype

The asset is a high-frame-rate video.

static var videoTimelapse: PHAssetMediaSubtype

The asset is a time-lapse video.

static var photoDepthEffect: PHAssetMediaSubtype

The asset is a photo captured with the Camera app's Portrait mode depth effect.

Relationships

Conforms To

See Also

Reading Asset Metadata

var mediaType: PHAssetMediaType

The type of the asset, such as video or audio.

enum PHAssetMediaType

Constants identifying the general type of an asset, such as image or video.

var mediaSubtypes: PHAssetMediaSubtype

The subtypes of the asset, identifying special kinds of assets such as panoramic photo or high-framerate video.

var sourceType: PHAssetSourceType

The means by which the asset entered the user’s Photos library.

struct PHAssetSourceType

Means by which an asset enters the Photos library, used by the PHAssetSourceType property.

var pixelWidth: Int

The width, in pixels, of the asset’s image or video data.

var pixelHeight: Int

The height, in pixels, of the asset’s image or video data.

var creationDate: Date?

The date and time at which the asset was originally created.

var modificationDate: Date?

The date and time at which the asset was last modified.

var location: CLLocation?

The location information saved with the asset.

var duration: TimeInterval

The duration, in seconds, of the video asset.

var isFavorite: Bool

A Boolean value that indicates whether the user has marked the asset as a favorite.

var isHidden: Bool

A Boolean value that indicates whether the user has hidden the asset.

var isSyncFailureHidden: Bool

A Boolean value that indicates whether the user has chosen to hide to the sync failure message.