PHLivePhoto Not Playing On UICollectionViewCell

442 Views Asked by At

I have created a UICollectionView that will display live photo's, the live photos are stored in an array and are working fine, except when i try to display them on the UICollectionViewCell's. They just wont play.

Here's what i tried : Added a UIView and changed its class to PHLivePhotoView, i've also tried adding an UIImageView and changing it's class just in case. I tried playing the live photos programmatically with: cell.livePhotoView.startPlaybackWithStyle(PHLivePhotoViewPlaybackStyle.Full) Which didn't work. Tried checking if my preview image was on top of the PHLivePhotoView, it wasn't the case.

If i take this route everything works fine

let livePhotoView = PHLivePhotoView(frame: self.previewImage.frame)
self.view.addSubview(livePhotoView)
livePhotoView.startPlaybackWithStyle(PHLivePhotoViewPlaybackStyle.Full)

The above works as expected.

Has anyone experienced the same issue? I don't know what i have overlooked.

0

There are 0 best solutions below