2

I created an app for iOS 11 with an UIDocumentViewController (From the Xcode 9 template). I registered document types to support .swift files (public.swift-script) and it’s working with open in place and Files app, but in the app’s browser, files with .swift extension are disabled and I can’t select them.

I don’t know if is an iOS 11 bug or me because it’s work if I set document types to work with public.item files.

NOTE: The same thing happens if I allow to pick multiple items, but if I click ‘Select All’, files are selected normally.

Ashley Mills
  • 50,474
  • 16
  • 129
  • 160
Emma Labbé
  • 667
  • 7
  • 18

1 Answers1

1

I may not have all the information I need, but using the template and my understanding of your question all I needed to do was add the UTI to the Info.plist like this:

Via Source

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeIconFiles</key>
        <array/>
        <key>CFBundleTypeName</key>
        <string>Source Code</string>
        <key>CFBundleTypeRole</key>
        <string>Editor</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.swift-source</string>
        </array>
    </dict>
    <dict/>
</array>

Via the GUI

If I misunderstood your question, let me know.

allenh
  • 6,582
  • 2
  • 24
  • 40
  • Wow, thanks, it’s worked, I added public.swift-script instead public.swift-source, with public.swift-source it’s worked – Emma Labbé Jun 30 '17 at 23:40
  • @ColdGrub1384 [Here](https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/UTIRef/Articles/System-DeclaredUniformTypeIdentifiers.html) is were I pulled the UTI from. – allenh Jul 01 '17 at 01:50
  • @ColdGrub1384 Please accept this answer if it solved your problem – Ashley Mills Aug 07 '17 at 08:54