PHPhotoPicker Albums

Hi devs, I am writing my firsts app in SwiftUI and there are lots of things to learn. In going for SwiftUI I am implementing some of the newer controls such as PHPhotoPicker (iOS 14+) which is permissioned dynamically by the user selecting content.

However, in the picker I would like the user to be able to see all their albums. Currently they see only the following:

Videos

Selfies

Time-Lapse

Slo-Mo

Cinematic

Screen Recordings

Import

Hidden

So is there any way to show for instance the album?, without reverting to an older picker view.

Thank you in advance to anyone who might know a way to enact this…

Hi! Users should be able to see all of their user albums by default, if you use the PhotosPicker or PHPickerViewController API.

What makes you believe that user albums are missing in the picker? Are you testing on a real device or the simulator? Do you have a code snippet and/or a screenshot you can share, to help us understand your problem better?

Hi Frameworks Engineer,

Thank you for taking the time to reply.

Here is the snippet of code for initialising the PHPickerConfiguration:

var phPickerConfig = PHPickerConfiguration(photoLibrary: .shared())
 
phPickerConfig.preferredAssetRepresentationMode = .current
phPickerConfig.selectionLimit = 1
phPickerConfig.filter = PHPickerFilter.any(of: [.videos])

let phPickerVC = PHPickerViewController(configuration: phPickerConfig)
phPickerVC.delegate = self

In the .plist settings there is:

<key>CFBundleDocumentTypes</key>
	<array>
		<dict>
			<key>CFBundleTypeExtensions</key>
			<array>
				<string></string>
			</array>
			<key>CFBundleTypeName</key>
			<string>mov</string>
			<key>CFBundleTypeRole</key>
			<string>Viewer</string>
			<key>LSHandlerRank</key>
			<string>Owner</string>
			<key>LSItemContentTypes</key>
			<array>
				<string>public.movie</string>
			</array>
		</dict>
	</array>

Finally how this appears in app. It correctly filters those albums which contain videos not images. However "Recently Deleted" contains videos but is not shown/listed.

PHPhotoPicker Albums
 
 
Q