---
title: "prepareToCaptureStillImageBracket(from:withSettingsArray:completionHandler:)"
framework: avfoundation
role: symbol
role_heading: Instance Method
path: "avfoundation/avcapturestillimageoutput/preparetocapturestillimagebracket(from:withsettingsarray:completionhandler:)"
---

# prepareToCaptureStillImageBracket(from:withSettingsArray:completionHandler:)

Allows the receiver to prepare resources in advance of capturing a still image bracket.

## Declaration

```swift
func prepareToCaptureStillImageBracket(from connection: AVCaptureConnection, withSettingsArray settings: [AVCaptureBracketedStillImageSettings], completionHandler handler: @escaping (Bool, (any Error)?) -> Void)
```

## Parameters

- `connection`: The connection through which the still image bracket should be captured.
- `settings`: An array of doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureBracketedStillImageSettings objects. All the array items must be of the same doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureBracketedStillImageSettings subclass, or an doc://com.apple.documentation/documentation/Foundation/NSExceptionName/invalidArgumentException exception is thrown.
- `handler`: A user provided block that will be called asynchronously once resources have successfully been allocated for the specified bracketed capture operation. The block has two parameters: If the count of the settings parameter exceeds doc://com.apple.avfoundation/documentation/AVFoundation/AVCaptureStillImageOutput/maxBracketedCaptureStillImageCount, then AVErrorMaximumStillImageCaptureRequestsExceeded is returned. You should not assume that the completion handler will be called on a specific thread.

## Discussion

Discussion Before taking a still image bracket, additional resources may need to be allocated. By calling this method first, you are able to know when the receiver is ready to capture the bracket with the specified settings array.

## See Also

### Related Documentation

- [captureStillImageAsynchronously(from:completionHandler:)](avfoundation/avcapturestillimageoutput/capturestillimageasynchronously(from:completionhandler:).md)

### Still image bracketed capture

- [captureStillImageBracketAsynchronously(from:withSettingsArray:completionHandler:)](avfoundation/avcapturestillimageoutput/capturestillimagebracketasynchronously(from:withsettingsarray:completionhandler:).md)
- [maxBracketedCaptureStillImageCount](avfoundation/avcapturestillimageoutput/maxbracketedcapturestillimagecount.md)
- [isLensStabilizationDuringBracketedCaptureSupported](avfoundation/avcapturestillimageoutput/islensstabilizationduringbracketedcapturesupported.md)
- [isLensStabilizationDuringBracketedCaptureEnabled](avfoundation/avcapturestillimageoutput/islensstabilizationduringbracketedcaptureenabled.md)
