<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 17.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AVFoundation",
  "identifier" : "/documentation/AVFoundation/AVCapturePhotoOutput/capturePhoto(with:delegate:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AVFoundation"
    ],
    "preciseIdentifier" : "c:objc(cs)AVCapturePhotoOutput(im)capturePhotoWithSettings:delegate:"
  },
  "title" : "capturePhoto(with:delegate:)"
}
-->

# capturePhoto(with:delegate:)

Initiates a photo capture using the specified settings.

```
func capturePhoto(with settings: AVCapturePhotoSettings, delegate: any AVCapturePhotoCaptureDelegate)
```

## Parameters

`settings`

The settings for the photo capture, such as the output pixel format and flash mode. This method copies the provided [`AVCapturePhotoSettings`](/documentation/AVFoundation/AVCapturePhotoSettings) object, so future changes to that object do not affect the capture in progress.
  
  > Important:
  > It is illegal to reuse a ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCapturePhotoSettings`` instance for multiple captures. Calling this method throws an exception (<doc://com.apple.documentation/documentation/Foundation/NSExceptionName/invalidArgumentException>) if the `settings` object’s ``doc://com.apple.avfoundation/documentation/AVFoundation/AVCapturePhotoSettings/uniqueID`` value matches that of any previously used settings object.

`delegate`

A delegate object to receive messages about capture progress and results. The photo output calls your delegate methods as the photo advances from capture to processing to delivery of finished images.

## Discussion

Use this method for all variations of still photography, including single photo capture,  RAW format capture (with or without a secondary format such as JPEG), bracketed capture of multiple images, and Live Photo capture.

When you call this method, the photo output validates the properties of your `settings` object to ensure deterministic behavior. For example, the [`flashMode`](/documentation/AVFoundation/AVCapturePhotoSettings/flashMode) setting must specify a value that is present in the photo output’s [`supportedFlashModes`](/documentation/AVFoundation/AVCapturePhotoOutput/supportedFlashModes-4u69s) array. See each property’s description in the [`AVCapturePhotoSettings`](/documentation/AVFoundation/AVCapturePhotoSettings) class reference for detailed validation rules.

---

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)