UIDocumentBrowserViewController – macCatalyst

  Kiến thức lập trình

UIDocumentBrowserViewController is showing white blank screen and then a textfile

It started happening with mac sonoma 14.4.1

func showDocumentPicker() {
        guard let dapa = UTType("com.my.dap.dapa"), let dapf = UTType("com.my.dap.dapf") else { return }
        
        let documentPicker = UIDocumentBrowserViewController(forOpening: [dapa, dapf])
        documentPicker.delegate = self
        documentPicker.allowsDocumentCreation = false
        documentPicker.allowsPickingMultipleItems = false
        
        // Create a close button
        let closeButton = UIBarButtonItem(barButtonSystemItem: .close, target: self, action: #selector(closeDocumentPicker))
        documentPicker.navigationItem.leftBarButtonItem = closeButton
        
        let navigationController = UINavigationController(rootViewController: documentPicker)
        present(navigationController, animated: true, completion: nil)
    }

Then window which stays permanently

Blank screen for few seconds here

blank screen appears for few seconds
enter image description here

LEAVE A COMMENT