10

I am trying to create a custom document icon for my multi-platform (iOS 14 - macOS Big Sur) app.

So, for macOS, it's pretty easy, I can either attach a legacy icon, or better, supply a combination of background, image and text, to composite a document icon, as described in macOS Document Icon Human Interface Guidelines.

So, in Info.plist, the UTExportedTypeDeclarations would contain a UTTypeIcons key like the following:

        <key>UTTypeIcons</key>
        <dict>
            <key>UTTypeIconBackgroundName</key>
            <string>Icon Fill</string>
            <key>UTTypeIconBadgeName</key>
            <string>Icon Image</string>
            <key>UTTypeIconText</key>
            <string>Dapka</string>
        </dict>

Now, the real challenge is in the iOS document icon. First, there are no updated documentation. Second, I couldn't do it like I did with macOS. Here, I should only supply one image, so I uploaded it as PNG in Resources folder, and then modified the UTExportedTypeDeclarations in Info.plist as following:

        <key>UTTypeIconFiles</key>
        <array>
            <string>Document Icon</string>
        </array>

But, the icon didn't appear correctly, it appeared as a centered image with white background, and no text.

Any ideas?

Adam M.
  • 85
  • 10
  • 1
    I'm unsure if you can add text to an icon thumbnail as macOS does, can't find any documentation references to plist keys that would enable such capability, but regarding image, you can add [Thumbnail Extension](https://developer.apple.com/documentation/quicklookthumbnailing/providing_thumbnails_of_your_custom_file_types) to your application and draw the thumbnail. – esesmuedgars Oct 08 '21 at 09:14
  • archive HIG link: https://web.archive.org/web/20210303220216/https://developer.apple.com/design/human-interface-guidelines/macos/icons-and-images/document-icons/ – freya Jun 04 '23 at 16:23

1 Answers1

1

You need to add CFBundleTypeIconsFiles in your Document Type in info.plist

enter image description here

Jayesh Patel
  • 938
  • 5
  • 16