# How to take photo

**URL:** <https://forums.kodeco.com/t/how-to-take-photo/19026>\
**Category:** iOS\
**Created:** [August 28, 2016, 3:05am UTC](https://forums.kodeco.com/t/how-to-take-photo/19026 "2016-08-28T03:05:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruce1971](https://s3.amazonaws.com/cdn.raywenderlich.com/community/forum-assets/noun-game-ghost-878668.png) [@bruce1971](https://forums.kodeco.com/u/bruce1971)\
**Post date:** [August 28, 2016, 3:05am UTC](https://forums.kodeco.com/t/how-to-take-photo/19026/1 "2016-08-28T03:05:33Z")

</div>

how do you add the volume buttons on phone to take photo / video like in stock camera can someone help with that thanks

---

<div class="post-metadata">

**Author:** ![intergalactic](https://assets.chunter.kodeco.com/user_avatar/forums.kodeco.com/intergalactic/32/70034_2.png) [@intergalactic](https://forums.kodeco.com/u/intergalactic)\
**Post date:** [September 2, 2016, 1:09am UTC](https://forums.kodeco.com/t/how-to-take-photo/19026/2 "2016-09-02T01:09:45Z")

</div>

As per [this tutorial](http://www.ioscreator.com/tutorials/take-photo-tutorial-ios8-swift)…

First, add `UIImagePickerControllerDelegate` to the class declaration. Add a variable `var imagePicker: UIImagePickerController!`, and call the camera

```
@IBAction func takePhoto(sender: UIButton) {
    imagePicker = UIImagePickerController()
    imagePicker.delegate = self
    imagePicker.sourceType = .Camera
  
    presentViewController(imagePicker, animated: true, completion: nil)
  }`

```

Process the image with

```
    func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [NSObject : AnyObject]) {
        imagePicker.dismissViewControllerAnimated(true, completion: nil)
        yourImageView.image = info[UIImagePickerControllerOriginalImage] as? UIImage // you can do what you want with the image here - in this case, it is setting an image view to it 
      }

```
