Adding file icon to custom file type in Xcode

1.1k views Asked by At

I'm trying to add an icon (a PNG named "FileIcon") to a custom file type in Xcode 13, but can't seem to actually add it via the interface in Xcode:

enter image description here

Any other way to do this?

enter image description here

enter image description here

enter image description here

1

There are 1 answers

3
Brianna Doubt On BEST ANSWER

Per Apple's article Setting Up a Document Browser App, there is a snippet in there for the plist:

<key>CFBundleDocumentTypes</key>
<array>
    <dict>
        <key>CFBundleTypeIconFiles</key>
        <array/>
        <key>CFBundleTypeName</key>
        <string>Text</string>
        <key>LSHandlerRank</key>
        <string>Alternate</string>
        <key>LSItemContentTypes</key>
        <array>
            <string>public.data</string>
        </array>
    </dict>
</array>

Is this set up correctly in your plist?