UIDocumentPickerViewController export deprecated in iOS 14

What approach should be used instead in iOS 14?
Answered by DTS Engineer in 618240022
Yeah, something weird is going on here. On the Objective-C side I see two initialisers that allow for export:
These are marked as NS_REFINED_FOR_SWIFT, so they’re not directly available to Swift. However, I can’t find the corresponding Swift-specific initialisers.



Ah, some digging reveals that this is a known bug (r. 64441569). These methods were not supposed to be marked as NS_REFINED_FOR_SWIFT. Please retest this with any future Xcode 12 beta seeds that come down the pike.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
UIDocumentPickerViewController isn’t deprecated as a whole. Rather, various init methods have been deprecated in favour of replacemetns that work in terms of the types defined in UniformTypeIdentifiers framework. For example, init(documentTypes:in:) has been deprecated in favour of init(forOpeningContentTypes:asCopy:).

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Thanks for the reply! I don't see anything having to do with export in UIDocumentPickerViewController class definition though, so how should the following be done in iOS 14?

UIDocumentPickerViewController(url: exportUrl, in: .exportToService)


Thanks again,

Jim
Accepted Answer
Yeah, something weird is going on here. On the Objective-C side I see two initialisers that allow for export:
These are marked as NS_REFINED_FOR_SWIFT, so they’re not directly available to Swift. However, I can’t find the corresponding Swift-specific initialisers.



Ah, some digging reveals that this is a known bug (r. 64441569). These methods were not supposed to be marked as NS_REFINED_FOR_SWIFT. Please retest this with any future Xcode 12 beta seeds that come down the pike.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"
Sweet, thanks for digging into that!
Is there also anywhere a documentation? What is initForOpeningContentTypes: doing, copying or moving?
UIDocumentPickerViewController export deprecated in iOS 14
 
 
Q