Reference

PHImageManager

PHImageManager is the PhotoKit class that loads images and videos for PHAsset objects, returning cached thumbnails or full-resolution data on demand. It handles downloading from iCloud, scaling, and request cancellation so apps never touch raw photo files directly.

iOS developmentiOSiPadOS

PHImageManager

Also known as: phimagemanager ios, request image, ios phimagemanager

PHImageManager is the PhotoKit class that loads images and videos for PHAsset objects, returning cached thumbnails or full-resolution data on demand. It handles downloading from iCloud, scaling, and request cancellation so apps never touch raw photo files directly.

  • Access via PHImageManager.default(); requires Photos library authorization (PHPhotoLibrary).
  • Set isNetworkAccessAllowed to download iCloud-only originals; the handler may fire twice (placeholder, then final).
  • Cancel in-flight loads with cancelImageRequest(_:) to keep scrolling smooth in large grids.

What PHImageManager does

PHImageManager is the bridge between a PHAsset (a logical photo or video reference) and actual pixel data. You never read files from the camera roll directly on iOS. Instead you call requestImage(for:targetSize:contentMode:options:resultHandler:) and the manager returns a UIImage sized for your request, pulling from the system thumbnail cache when possible.

Use the shared instance via PHImageManager.default(). For collection views and grids, request small targetSize values so the system serves cached thumbnails instead of decoding full-resolution originals. The result handler can be called multiple times: a fast low-quality placeholder first, then the final image.

Options, iCloud, and cancellation

PHImageRequestOptions controls behavior. Set isNetworkAccessAllowed = true to let the manager download originals stored in iCloud Photos (optimized-storage devices keep only thumbnails locally). The deliveryMode picks between fast-but-degraded and high-quality, and resizeMode controls scaling. Every request returns a PHImageRequestID you can pass to cancelImageRequest(_:) when a cell scrolls offscreen.

For full original bytes rather than a display image, use requestImageDataAndOrientation(for:options:resultHandler:), or move to PHAssetResource when you need exact file sizes and resource types.

Related terms

Keep reading the reference.

Act on it

Guides and tools for this topic.