<!--
{
  "availability" : [
    "iOS: 9.1.0 -",
    "iPadOS: 9.1.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/Photos/PHLivePhoto/request(withResourceFileURLs:placeholderImage:targetSize:contentMode:resultHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(cs)PHLivePhoto(cm)requestLivePhotoWithResourceFileURLs:placeholderImage:targetSize:contentMode:resultHandler:"
  },
  "title" : "request(withResourceFileURLs:placeholderImage:targetSize:contentMode:resultHandler:)"
}
-->

# request(withResourceFileURLs:placeholderImage:targetSize:contentMode:resultHandler:)

Asynchronously loads a Live Photo from the specified resource files.

```
class func request(withResourceFileURLs fileURLs: [URL], placeholderImage image: UIImage?, targetSize: CGSize, contentMode: PHImageContentMode, resultHandler: @escaping (PHLivePhoto?, [AnyHashable : Any]) -> Void) -> PHLivePhotoRequestID
```

## Parameters

`fileURLs`

An array of URLs containing only the still URL and the video URL that constitute a Live Photo, as obtained using the [`PHAssetResource`](/documentation/Photos/PHAssetResource) class.

`image`

A static image to represent the Live Photo before its full content has been loaded and validated.

`targetSize`

The target size of Live Photo to be returned. Pass `CGSizeZero` to obtain the requested Live Photo at its original size.

`contentMode`

An option for how to fit the image to the aspect ratio of the requested size. For details, see [`PHLivePhoto`](/documentation/Photos/PHLivePhoto).

`resultHandler`

A block to be called when image loading is complete, providing the requested Live Photo or information about the status of the request.

    The block takes the following parameters:

- result: The requested Live Photo object.
- info: A dictionary providing information about the status of the request. See [`PHLivePhoto`](/documentation/Photos/PHLivePhoto) for possible keys and values.

## Return Value

A numeric identifier for the request. If you need to cancel the request before it completes, pass this identifier to the [`cancelRequest(withRequestID:)`](/documentation/Photos/PHLivePhoto/cancelRequest(withRequestID:)) method.

## Discussion

Use this method to load Live Photo objects for display from data files previously exported from a Photos library. For example, a social networking app can use the [`PHAssetResource`](/documentation/Photos/PHAssetResource) class to retrieve the data files that constitute a Live Photo in one user’s library and upload them to a server. Then, on another user’s device, the app downloads those data files and uses this method to re-create a Live Photo object for display using the [`PHLivePhotoView`](/documentation/PhotosUI/PHLivePhotoView) class.

> Note:
> To instead obtain a ``doc://com.apple.photokit/documentation/Photos/PHLivePhoto`` object representing a Live Photo asset from the user’s Photos library, use the ``doc://com.apple.photokit/documentation/Photos/PHAsset`` class to locate the asset and the ``doc://com.apple.photokit/documentation/Photos/PHImageManager`` class to fetch the asset’s Live Photo data for display.
> 
> To instead import a Live Photo to the Photos library, use the ``doc://com.apple.photokit/documentation/Photos/PHAssetCreationRequest`` class.

This method is asynchronous. Photos loads, validates, and prepares data on a background thread, then calls your `resultHandler` block with a ready-to-display Live Photo object. Like the similar methods in the PHImageManager class, Photos can call your result handler block more than once—first, to provide a low-quality Live Photo object (consisting of only the static image from the `image` parameter), then later to provide the full motion and sound content of the Live Photo. If the [`PHLivePhotoInfoIsDegradedKey`](/documentation/Photos/PHLivePhotoInfoIsDegradedKey) value in your result handler’s `info` dictionary is `true`, Photos will call your result handler again.

This method can load a [`PHLivePhoto`](/documentation/Photos/PHLivePhoto) object only from the same set of files exported from a previously captured Live Photo asset. When you use this method, Photos validates that the files and their metadata can be loaded as a Live Photo. If Photos cannot load a Live Photo from the specified files, the `result` parameter in your result handler block is `nil`, and the `info` dictionary contains an `NSError` object describing the error.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)