---
title: takePicture()
framework: uikit
role: symbol
role_heading: Instance Method
path: uikit/uiimagepickercontroller/takepicture()
---

# takePicture()

Captures a still image using the camera.

## Declaration

```swift
func takePicture()
```

## Discussion

Discussion Use this method in conjunction with a custom overlay view to initiate the programmatic capture of a still image. This supports taking more than one picture without leaving the interface, but requires that you hide the default image picker controls. Calling this method while an image is being captured has no effect. You must wait until the associated delegate object receives an imagePickerController(_:didFinishPickingMediaWithInfo:) message before you can capture another picture. Calling this method when the source type of the image picker is set to a value other than UIImagePickerController.SourceType.camera results in the throwing of an invalidArgumentException exception.

## See Also

### Related Documentation

- [cameraOverlayView](uikit/uiimagepickercontroller/cameraoverlayview.md)

### Capturing still images or movies

- [startVideoCapture()](uikit/uiimagepickercontroller/startvideocapture().md)
- [stopVideoCapture()](uikit/uiimagepickercontroller/stopvideocapture().md)
