Enumeration

PHAssetMediaType

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

Declaration

enum PHAssetMediaType : Int

Overview

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

Topics

Constants

case unknown

The asset’s type is unknown.

case image

The asset is a photo or other static image.

case video

The asset is a video file.

case audio

The asset is an audio file.

See Also

Reading Asset Metadata

var mediaType: PHAssetMediaType

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

var mediaSubtypes: PHAssetMediaSubtype

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

struct PHAssetMediaSubtype

Constants identifying specific variations of asset media, such as panorama or screenshot photos and time lapse or high frame rate 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.

Deprecated