title: ios - Determine if image picker media type is video or photo
body: <p>I have UIImagePickerController which is choosing photo or video from gallery, after selecting item, I want to determine which one is chosen, photo or video</p>
  
  <pre><code> func imagePickerController(picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : AnyObject]) {
      let mediaType = info[UIImagePickerControllerMediaType]
  
   }
  </code></pre>
  
  <p>I've found this: <a href="https://stackoverflow.com/questions/10480170/how-to-select-any-video-or-movie-file-from-uiimagepickercontroller">How to select any Video or Movie file from UIImagePickerController</a></p>
  
  <p>but could not translate to Swift:</p>
  
  <pre><code> if (CFStringCompare ((__bridge CFStringRef) mediaType, kUTTypeMovie, 0) == kCFCompareEqualTo) {
  
   }
  </code></pre>
  
  <p>thank you in advance</p>