I'm having some trouble creating a PHLivePhotoEditingContext
in order to apply filters using CoreImage
.
However, in order to create a PHLivePhotoEditingContext
the steps are to:
- Instantiate a
PHAsset
object. - Call the
requestContentEditingInput(with:completionHandler:)
- Use the
PHContentEditingInput
to instantiate aPHLivePhotoEditingContext
.
However, my understanding of PHAsset
is it's only available for apps and not Swift Playgrounds. Am I wrong in that assessment? If I'm wrong are there any ways to create a PHLivePhotoEditingContext
to edit live photos in my swift playground (stored in the Resources
directory as a .mov
and .JPG
? If I can't create a PHLivePhotoEditingContext
are there alternate ways to efficiently apply Core Image
filters onto live photos within my playground?
I'm currently writing my code out in a playground but ultimately it will go in a playground book, so if it works in the playground book and not the playground that is fine.