1

I'm facing issues on 16.0 using PHPickerViewController with PHPickerConfiguration config.selection = .people. The PHPicker screen shows an error "Unable to Load Photos". Xcode 14.0.1.

import UIKit
import PhotosUI

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        showPicker()
    }

    private func showPicker() {
        var config = PHPickerConfiguration(photoLibrary: .shared())
        config.filter = .images
        config.selection = .people
        config.selectionLimit = 10
        let vc = PHPickerViewController(configuration: config)
        vc.delegate = self
        self.present(vc, animated: true, completion: nil)
    }

}

extension ViewController: PHPickerViewControllerDelegate {
    func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {

    }
}

Console log:

[Picker] Showing picker unavailable UI (reason: crashed) with error: (null) viewServiceDidTerminateWithError:: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted}

If I comment that line (config.selection = .people) it works perfect.

My question is: Has anyone gone through this? know how to fix it?

1
  • hey fabrizio, i tried the code for myself and i couldn't see any selection enum value for .people and also couldn't find any people value in documentation, are you sure that you are using the correct one? Commented Apr 30, 2024 at 16:44

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.