title: Swift - How to load videos from photo album and display them in collection view
body: <p>I used <code>PHImageManager</code> to load images from photo album.
  Here is my code...</p>
  
  <pre><code>var photoLibrary = [UIImage]()
      func grabPhotos(){
          let imgManager = PHImageManager.default()
  
          let requestOptions = PHImageRequestOptions()
          requestOptions.isSynchronous = true
          requestOptions.deliveryMode = .highQualityFormat
  
          let fetchOptions = PHFetchOptions()
          fetchOptions.sortDescriptors = [NSSortDescriptor(key: "creationDate", ascending: false)]
          if let fetchResult : PHFetchResult = PHAsset.fetchAssets(with: .image, options: fetchOptions) {
              if fetchResult.count &gt; 0 {
                  for i in 0..&lt;fetchResult.count{
                      imgManager.requestImage(for: fetchResult.object(at: i) as PHAsset , targetSize: CGSize(width: 200, height: 200), contentMode: .aspectFill, options: requestOptions, resultHandler: {
                          image, error in
                          self.photoLibrary.append(image!)
                      })
                  }
              }
              else{
                  showAllertToImportImage()//A function to show alert
              }
          }
      }
  </code></pre>
  
  <p>Now I want to load videos from photo album and I need to show them in <code>UICollectionView</code>.
  For loading images in <code>UICollectionView</code> I used <code>UIImageView</code> in the cell. What should I use in the cell to load videos ?
  I also need to show the video duration. </p>