<!--
{
  "availability" : [
    "iOS: 3.1.0 -",
    "iPadOS: 3.1.0 -",
    "macCatalyst: 13.1.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIImagePickerController/takePicture()",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UIImagePickerController(im)takePicture"
  },
  "title" : "takePicture()"
}
-->

# takePicture()

Captures a still image using the camera.

```
func takePicture()
```

## 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:)`](/documentation/UIKit/UIImagePickerControllerDelegate/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`](/documentation/UIKit/UIImagePickerController/SourceType-swift.enum/camera) results in the throwing of an <doc://com.apple.documentation/documentation/Foundation/NSExceptionName/invalidArgumentException> exception.

## See Also

[`cameraOverlayView`](/documentation/UIKit/UIImagePickerController/cameraOverlayView)

The view to display on top of the default image picker interface.



---

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)