I'm trying to set custom Icons for my documents created in a Mac Catalyst app. The icon I defined appears on iOS apps fine. But on my mac they all have a generic icon. I have added the CFBundleTypeIcons key to my info.plist and added an .icns file to my app but it changes nothing. What am I not doing here that I should be?
To set up an icon for a custom document type, I'd do the following:
- Specify the icon file using this Info.plist entry:
CFBundleDocumentTypes
>CFBundleTypeIconFile
:
<key>CFBundleDocumentTypes</key>
<array>
<key>CFBundleTypeIconFile</key>
<string>Your_Icon_File.icns</string>
……
</dict>
</array>
- If you export the document type, specify the icon file using this Info.plist entry:
UTExportedTypeDeclarations
>UTTypeIcons
>UTTypeIconName
:
<key>UTExportedTypeDeclarations</key>
<array>
<dict>
…...
<key>UTTypeIcons</key>
<dict>
<key>UTTypeIconName</key>
<string>Your_Icon_File_Name</string>
</dict>
…...
</dict>
</array>
- Implement a Thumbnail extension for your app. This provides a thumbnail based on the document content, and works around the corner cases where some system components don't respect the icon specified in the Info.plist. The topic is covered in Providing Thumbnails of Your Custom File Types.
It seems that you have done #1 and #2, and so I'd suggest that you do #3 to see if that works – If it doesn't, which indicates that something in the macCatalyst
environment goes wrong, I’d suggest that you file a feedback report (http://developer.apple.com/bug-reporting/) and share your report ID here.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.