UIDocumentPickerViewController падает после выбора документов - PullRequest
0 голосов
/ 20 июня 2019

Я сейчас работаю над MacOs 10.15 beta 2, Xcode 11 beta 2, iPadOS 13 beta 2 (iPad Air 2),

Я добавил UIDocumentPickerViewController в качестве дочернего viewController в виде вкладки следующим образом.

var controller : UIDocumentPickerViewController!
func addDocumentPickerController() {

    controller = UIDocumentPickerViewController(
        documentTypes: ["public.png"], // choose your desired documents the user is allowed to select
        in: .import // choose your desired UIDocumentPickerMode
    )
    controller.delegate = self
    controller.hidesBottomBarWhenPushed = true
    controller.allowsMultipleSelection = true

    self.view.addSubview(controller.view)
    let window = UIApplication.shared.keyWindow
    let topPadding = window?.safeAreaInsets.top

    self.controller.view.snp.makeConstraints { (make) in
        make.leading.equalToSuperview()
        make.trailing.equalToSuperview()
        make.top.equalTo(topPadding ?? 0)
        make.bottom.equalToSuperview()
    }
}

Сейчас у делегатов

func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentsAt urls: [URL]) {
}

этот метод не вызывается.

Только ниже ошибка в консоли.

[TraitCollection] Class _UIRootPresentationController overrides the -traitCollection getter, which is not supported. If you're trying to override traits, you must use the appropriate API.
[TraitCollection] Class UIPopoverPresentationController overrides the -traitCollection getter, which is not supported. If you're trying to override traits, you must use the appropriate API.
[TraitCollection] Class _UISheetPresentationController overrides the -traitCollection getter, which is not supported. If you're trying to override traits, you must use the appropriate API.
[TraitCollection] Class UIPreviewPresentationController overrides the -traitCollection getter, which is not supported. If you're trying to override traits, you must use the appropriate API.
[DocumentManager] The view service did terminate with error: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted}
[DocumentManager] Remote view controller crashed with error: Error Domain=_UIViewServiceInterfaceErrorDomain Code=3 "(null)" UserInfo={Message=Service Connection Interrupted}. Trying to relaunch.

Любая идея об этом происходит.

...