Can Poyrazoğlu
Can Poyrazoğlu

Reputation: 34830

How to limit UIImagePickerController to only picking portrait mode (depth effect) photos?

I'm building an app that deals with images taken in Portrait Mode (Depth Effect). I need to present UIImagePickerController to only display photos that have depth effect.

How do I achieve this?

Upvotes: 1

Views: 174

Answers (1)

glyvox
glyvox

Reputation: 58149

This is not possible with the public methods of UIImagePickerController. Use a custom image picker for this.

For checking if a specific PHAsset has a depth effect, check whether its mediaSubtypes property is equal to .photoDepthEffect:

if asset.mediaSubtypes == .photoDepthEffect {
    //live photo          
}

Upvotes: 2

Related Questions