title: ios custom takePicture button
body: <p>I want my custom button to take a picture using <code>UIImagePickerController</code> and to save it in my device.</p>
  
  <p>I can save the picture in the device using the default camera controls, although when i turn them off and start using my custom button it doesn't do the job.</p>
  
  <pre><code>- (IBAction)takePhoto:(id)sender {
      [picker takePicture];
  }
  
  - (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
  
      UIImage *chosenImage = info[UIImagePickerControllerEditedImage];
      self.imageView.image = chosenImage;
      UIImageWriteToSavedPhotosAlbum(chosenImage, nil, nil, nil);
  
      [picker dismissViewControllerAnimated:YES completion:nil];
  }
  </code></pre>
  
  <p><code>didFinishPickingMediaWithInfo</code> is being called but the picture isn't being saved.</p>
  
  <p>How can i achieve this?</p>