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?
On your Mac, select the file or folder. Choose File > Get Info in the menu bar. At the top of the Info window, select the small custom icon. Make sure you click the small icon at the top of the Info window (not the large icon under Preview).
Right click extension whose icon you want to change and then select “Edit Selected File Type.” In the “Edit File Type” window, click the “…” button to the right of the Default Icon text field. The “Change Icon” window shows some basic icons, but click the “Browse” button to find your own icon files.
The ICO file format is an image file format for computer icons in Microsoft Windows.
Traditionally, a document icon looks like a piece of paper with its top-right corner folded down. This distinctive appearance helps people distinguish documents from apps and other content, even when icon sizes are small.
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) |
+-----------------------+----------------------------------+
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
You must add the fours icons as image above.
Then you can see the icon inside Document Types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With