Playing a Video in a UICollectionViewCell
Right in the cell!
2 min readJun 4, 2021
I thought I’d make a project.
Can I play a video in a UICollectionViewCell? You know what? I can!
This is an article about how to do just that — but if you want a YouTube video I’ve got that for you too:
Before we start
Difficulty: Beginner | Easy | Normal | Challenging
This article has been developed using Xcode 12.5, and Swift 5.4
Prerequisites:
- You’ll need to either be able to write an iOS application or write some Swift code in Playgrounds
- This article is self-contained, but you would benefit from having some experience producing a UICollectionView & UICollectionViewCell programmatically, as described in another article
Terminology
UICollectionView: An object that manages an ordered collection of data items and presents them using customizable layouts
UICollectionViewCell: The on-screen cell for the UICollectionView type
This Article
Wouldn’t it be great if you could play video in a UICollectionViewCell
, you know, like Instagram does it (and I have written an article about)