title: Save a Video that I record in my app
body: <p>I am succeeding in understanding how to make a camera app in my learning journey:-)</p>
  
  <p>The only thing I am stuck with is saving a video that I have recorded. I am able to save a photo, but the same does not work for videos.</p>
  
  <p>So I think I have almost got it with the help of iBrad Apps.</p>
  
  <p>got this code:</p>
  
  <pre><code>-(void)imagePickerController:(UIImagePickerController *)picker
     didFinishPickingMediaWithInfo:(NSDictionary *)info
   {
  NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];
  
  [self dismissModalViewControllerAnimated:YES];
  
  if ([mediaType isEqualToString:(NSString *)kUTTypeImage]) {
      UIImage *image = [info 
                        objectForKey:UIImagePickerControllerOriginalImage];
  
      imageView.image = image;
  
      if (newMedia)
          UIImageWriteToSavedPhotosAlbum(image, 
                                         self,
                                         @selector(image:finishedSavingWithError:contextInfo:),
                                         nil);
  }
  else{
  
      if ([mediaType isEqualToString:(NSString *)kUTTypeMovie]) {
          UIImage *movie = [info 
                            objectForKey:UIImagePickerControllerQualityTypeHigh];
  
          videoRecorder2.image = movie;
  
              if (newMedia)
                  UISaveVideoAtPathToSavedPhotosAlbum(movie, 
                                                 self,
                                                 @selector(movie:finishedSavingWithError:contextInfo:),
                                                 nil);
  }}}
  </code></pre>
  
  <p>I have an if statement because the app can take both video and still images.</p>
  
  <p>The first part is for still - which works and then the second part I am still tutu-ing with:-)</p>