<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIImageWriteToSavedPhotosAlbum(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@F@UIImageWriteToSavedPhotosAlbum"
  },
  "title" : "UIImageWriteToSavedPhotosAlbum(_:_:_:_:)"
}
-->

# UIImageWriteToSavedPhotosAlbum(_:_:_:_:)

Adds the specified image to the user’s Camera Roll album.

```
func UIImageWriteToSavedPhotosAlbum(_ image: UIImage, _ completionTarget: Any?, _ completionSelector: Selector?, _ contextInfo: UnsafeMutableRawPointer?)
```

## Parameters

`image`

The image to write to the Camera Roll album.

`completionTarget`

Optionally, the object whose selector should be called after the image has been written to the Camera Roll album.

`completionSelector`

The method selector of the `completionTarget` object to call. This optional method should conform to the following signature:

```objc
- (void)image:(UIImage *)image
    didFinishSavingWithError:(NSError *)error
                 contextInfo:(void *)contextInfo;
```

`contextInfo`

An optional pointer to any context-specific data that you want passed to the completion selector.

## Discussion

When used with an image picker controller, you would typically call this function within your [`imagePickerController(_:didFinishPickingMediaWithInfo:)`](/documentation/UIKit/UIImagePickerControllerDelegate/imagePickerController(_:didFinishPickingMediaWithInfo:)) delegate method implementation.

The use of the `completionTarget`, `completionSelector`, and `contextInfo` parameters is optional and necessary only if you want to be notified asynchronously when the function finishes writing the image to the user’s Camera Roll or Saved Photos album. If you do not want to be notified, pass `nil` for these parameters.

When used on an iOS device without a camera, this method adds the image to the Saved Photos album rather than to the Camera Roll album.

---

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)