Make UIDocument File Wrapper Appear as Single File

August 3rd, 2018

Filed under: iOS Development | Be the first to comment!

I was recently working on an iOS document-based app that saves the document in a file wrapper. When I looked in the document browser, the document appeared as a folder instead of a single file. For Mac document types Xcode has a checkbox to select to make the document appear as a single file, but iOS document types do not have this checkbox. How do you make the document appear as a single file?

To make the document appear as a single file in the document browser, the document’s exported UTI must conform to the UTI com.apple.package. In Xcode’s project editor, add com.apple.package to the Conforms To text field for the exported UTI.

ExportedUTIFileWrappersHighlighted

Rebuild your project. Any documents you save should appear as single files instead of folders.


Leave a Reply

Your email address will not be published. Required fields are marked *