1

I'm writing an iOS app, and I would like to be able to view all of the files in iCloud drive. I've setup a UIDocumentPickerViewController with the following array of UTIs:

["\(kUTTypeContent)","\(kUTTypeData)","\(kUTTypeItem)"]

However, some types aren't showing, like iWork documents. iWork conforms to public.package, which conforms at the top to public.item. Do I need to declare all of the file UTIs individually? I've tried with PDFs, and they work fine.

Halen
  • 456
  • 4
  • 14

1 Answers1

2

There is a bug in iOS8 with iWork files, as workaround you can specify iWork's UTIs individually. Sample code from my category:

+ (NSArray *)fp_supportedDocumentTypes {
    return @[(__bridge NSString *) kUTTypeContent,
            (__bridge NSString *) kUTTypeData,
            (__bridge NSString *) kUTTypePackage,
            NL(@"com.apple.iwork.pages.pages"),
            NL(@"com.apple.iwork.numbers.numbers"),
            NL(@"com.apple.iwork.keynote.key")];
}
Ponf
  • 1,190
  • 1
  • 12
  • 28
  • Thanks. That it now shows iWork. I'm still having problem with another type. In the container for iA Writer, I have a markdown (.md) file, and I can't access the container. Is there not a catch-all UTI? – Halen Oct 21 '14 at 19:50
  • 1
    I added net.daringfireball.markdown and markdown now works, even though it conforms eventually to a UTI I already supported. Weird. – Halen Oct 22 '14 at 17:04
  • @Halen yes, it's really annoying bug :( Glad to hear, that my solution works for you. – Ponf Oct 22 '14 at 17:10
  • 1
    so there is no "All Documents" UTI? – Georg Nov 18 '14 at 13:38
  • 1
    @Georg in general, every type should conforms to `kUTTypeContent` or `kUTTypeData` (based on documentation https://developer.apple.com/library/mac/Documentation/FileManagement/Conceptual/understanding_utis/understand_utis_conc/understand_utis_conc.html#//apple_ref/doc/uid/TP40001319-CH202-CHDHIJDE), but currently it doesn't work. – Ponf Nov 18 '14 at 15:41
  • Can you please help with similar question. http://stackoverflow.com/questions/30613645/add-edit-in-exel-or-edit-photo-extension – Durgaprasad Jun 04 '15 at 13:30