Make UIDocument File Wrapper Appear as Single File

August 3rd, 2018

Filed under: iOS Development | 1 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.


One thought on “Make UIDocument File Wrapper Appear as Single File

  1. Chad says:

    Thanks so much for this key bit of info. I was banging my head on my desk for a full day trying to figure out why a UIManagedDocument I was creating was showing up as a folder. Your tip solved the problem!

Leave a Reply

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