Question

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?

Was it helpful?

Solution

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 your Info.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) |
+-----------------------+----------------------------------+

OTHER TIPS

Thanks @TomSwift for your answer help me a lot. I just add this if you have Xcode 6.3.2.

You can not add icon files drag and drop or press "+" button inside info section, instead you must add the icon files names directly info.plist enter image description here

You must add the fours icons as image above.

Then you can see the icon inside Document Types.

enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top