How to filter screenshots, cinematic videos, and depth-effect photos in PHPickerViewController
In iOS 14.0, Apple introduced a new way to pick images from the device’s photo library using PHPickerViewController. (If you are not aware of PHPickerViewController, I strongly recommend you to read about PHPickerViewController first.)
Different apps have different requirements. For example, a hi-res video editing app might be interested in showing cinematic videos and videos.
A screenshot stitching app might be interested in showing screenshots upfront. From iOS 16.0, Apple has introduced new APIs, making filtering media very easy.
If your app wants to show cinematic videos, you can use the cinematicVideos
enum.
PHPickerViewController example of filtering cinematic videos
Similarly, you can filter screenshots
, screenRecordings
, depthEffectPhotos
, and much more. You can read the
PHPickerFilter documentation to learn more about the new filter enums.
To filter only screenshots
To filter only screen recordings
To filter only depth effect photos
The best part is that all the filters except cinematicVideos
, depthEffectPhotos
, and bursts
are backported to iOS 15.0
You can also add compound filters and refine your media results using all
and not
. They are also backported to iOS 15.0
References
[1] What’s new in the Photos picker
About the author
- Rizwan Ahmed - Senior iOS Engineer, speaker, and an open source enthusiast. Twitter - https://twitter.com/rizwanasifahmed
Support creators
Show your support to indie devs by downloading their apps from the banner displayed below. It will help them build great apps in these tough times.
More articles
Like our articles? Support us!