An ALAssetRepresentation object encapsulates one of the representations of a given ALAsset object.


class ALAssetRepresentation : NSObject


A given asset in the library may have more than one representation. For example, if a camera provides RAW and JPEG versions of an image, the resulting asset will have two representations—one for the RAW file and one for the JPEG file.


Getting Image Representations

func cgImage(options: [AnyHashable : Any]!) -> Unmanaged<CGImage>!

Returns a full resolution CGImage of the representation.

func fullResolutionImage() -> Unmanaged<CGImage>!

Returns a CGImage representation of the asset.

func fullScreenImage() -> Unmanaged<CGImage>!

Returns a CGImage of the representation that is appropriate for displaying full screen.

Getting Image Attributes

func orientation() -> ALAssetOrientation

Returns the representation’s orientation.

func scale() -> Float

Returns the representation’s scale.

func dimensions() -> CGSize

Returns the representation’s dimensions.

func filename() -> String!

Returns a string representing the filename of the representation on disk.

Getting Raw Data

func size() -> Int64

Returns the size in bytes of the file for the representation.

Getting Metadata

func uti() -> String!

Returns the representation's UTI.

func metadata() -> [AnyHashable : Any]!

Returns a dictionary of dictionaries of metadata for the representation.

Getting an URL

func url() -> URL!

Returns a persistent URL uniquely identifying the representation.


Inherits From

Conforms To