Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Icons for custom file types (iOS or OS X)

Tags:

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?

like image 823
Stuart Avatar asked May 28 '13 20:05

Stuart


People also ask

How to change icon for file type on Mac?

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).

How do I assign a custom icon to a file type?

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.

What are the types of file icons?

The ICO file format is an image file format for computer icons in Microsoft Windows.

What is document icon?

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.


2 Answers

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) |
+-----------------------+----------------------------------+
like image 84
TomSwift Avatar answered Oct 27 '22 22:10

TomSwift


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

like image 20
Beto Avatar answered Oct 27 '22 22:10

Beto