I have a folder in the document directory containing images and videos. In my application, I have a collection that displays images in each cell.
I accomplished this with an image upload function that returns a UIImage
// Get the UI Image from the path passed in let image = UIImage(contentsOfFile: path) if image == nil { print("No Image at this path"); } else { return image }
However, I cannot find something equivalent for the video. Ideally, I want it to show as a video player, as in a photo album, where you still see the video with a small play button on it, which is when you press the video playback.
If you cannot get a still video on the specified path, I should be returned as a UIImage , which I can display will be fine.
I'm new to iOS, so it's just interesting if there is some equivalent type like UIImage for video, which means that I can just load and display it as a collection.
source share