Supported file types and extensions are registered in the Info.plist file. Everything you read will say to edit that file directly, but there is a better way. Quoting the Q&A page: To add the document type do the following:
- In your Xcode project, select the target you want to add the document type to.
- Select the Info tab.
- Click on the disclosure button for Document Types to open the document types.
- Click the “+” button.
- In the newly created document type :
- Type the name of the document type.
- In the “Types” section fill in the UTI for the new type.
- Provide an icon for the document.
- Click the disclosure triangle to open Additional document type properties.
- Click in the table to add a new key and value.
- For the key value type: CFBundleTypeRole.
- For the value type: Editor.
- Click the + button to add another key/value pair.
- For the key value type: LSHandlerRank.
- For the value type: Owner.
There’s more on that same page:
- Adding a custom UTI. If it’s a custom UTI you need to add it. This is how you associate file extensions with the UTI.
- How to test (hint: send the document as email)
- Troubleshooting
Also look at the original documentation, though it doesn’t mention how XCode can help. See: Registering the File Types Your App Supports and Uniform Type Identifiers.
Detailed info keys for document file types: CFBundleDocumentTypes
h/t