Options for fitting an image’s aspect ratio to a requested size, used by the requestImage(for:targetSize:contentMode:options:resultHandler:) method.


enum PHImageContentMode : Int


With either option, the resulting image may not exactly match the target size, depending on the deliveryMode and resizeMode properties of the image request. To serve your request more quickly, Photos may provide a slightly larger image—one that it can generate more easily or one that is already cached.



static var `default`: PHImageContentMode

Fits the image to the requested size using the default option, PHImageContentMode.aspectFit.

case aspectFit

Scales the image so that its larger dimension fits the target size.

case aspectFill

Scales the image so that it completely fills the target size.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software