I'm looking for information/documentation on creating a custom icon for a document type in my iOS app. I am sure I have seen some Apple developer guide with information about this, but I have been searching and cannot find it!
In the app's Info.plist I have specified a custom document type, and a corresponding exported UTI (conforming to com.apple.package). Xcode makes it quite easy to specify images for these under the "Info" tab of the target settings, but I can't find the information regarding what sizes they should be, or in what situations the document icon will be visible. I believe that iOS automatically creates a 'default' document icon for you using the app icon (as per this section of the HIG), so if I made it possible for users to share the document via email, another user with the app installed on their iOS device would see this default document icon.
Where else might this document icon be seen? Currently in iTunes file sharing the document appears as a directory with the custom file extension - presumably this would change if an icon was specified for the document? When viewing one of the documents in the OS X file system, it appears as a standard white document (i.e. looks like an unknown file type) - is there any way for this to appear with the proper icon, or would the user need a Mac app installed that specifies such a file type?
You already found the HIG documentation. I'm not certain if document icons show up in iTunes, but I doubt it. I've never seen this from any other app.
From the Information Property List Key Reference (search for "Document Icons"):
Document Icons
In iOS, the
CFBundleTypeIconFiles
key contains an array of strings with the names of the image files to use for the document icon. Table 3 lists the icon sizes you can include for each device type. You can name the image files however you want but the file names in yourInfo.plist
file must match the image resource filenames exactly. (For iPhone and iPod touch, the usable area of your icon is actually much smaller.) For more information on how to create these icons, see iOS Human Interface Guidelines.
Table 3 Document icon sizes for iOS
+-----------------------+----------------------------------+
| Device | Sizes |
+-----------------------+----------------------------------+
| iPad | 64 x 64 pixels |
| | 320 x 320 pixels |
+-----------------------+----------------------------------+
| iPhone and iPod touch | 22 x 29 pixels |
| | 44 x 58 pixels (high resolution) |
+-----------------------+----------------------------------+