How to use UIDocumentPickerViewController to import files in iOS 16

175 Views Asked by At

I was trying to use the UIDocumentPickerViewController to import some pdf files in my Swift UIKit App. I'm not able to properly use the UIDocumentPickerViewController to display the files app and import the files from there.

The initialiser UIDocumentPickerViewController(documentTypes: [String], in: UIDocumentPickerMode) was deprecated in iOS 14.0. I can still use it but is there a better way to do the same thing which is not deprecated and is used in the latest version of iOS?

1

There are 1 best solutions below

0
Roy0Anonymous On

Importing "UniformTypeIdentifiers" seems to enable the "init(forOpeningContentTypes: [UTType])" initializer.