Creating your own UTI for an iOS app
Asked Answered
J

1

11

The app I'm developing has a custom file format for its files, and I'd like to be able to use the "Open In ..." feature of iOS which lets users e.g. email each other a file and then open it directly in the app.

I've gotten as far as adding the CFBundleDocumentType stuff in the Info.plist file, but the problem is the LSItemContentTypes. From what I've read, I need to provide the actual file as a UTI, rather than just saying ".myfileextension", and I can't find a lot about how to create UTI's in a iOS app.

Anyone know?

Jaques answered 27/12, 2010 at 15:49 Comment(0)
F
13

You will want to read up on the following topics from Apple:

Adopting Uniform Type Identifiers
Introduction to Uniform Type Identifiers Overview
Declaring New Uniform Type Identifiers

From the documentation:

If your application uses proprietary data formats, you should declare them in the Info.plist file of your application bundle. Some guidelines:

  • Your UTI string must be unique. Following the reverse-DNS format beginning with com.companyName is a simple way to ensure uniqueness. While the system can support different UTI strings with the same specification, the reverse is not true.

  • If your code relies on third-party UTI types that may not be present on the system, you should declare those UTIs as imported types in your bundle.

  • Be sure to add conformance information if your proprietary type is a subtype of one or more existing types. In most cases you should not specify conformance to a nonpublic type, unless you are also declaring that type in your bundle. For a list of public and Apple-defined UTIs, see "System-Declared Uniform Type Identifiers"

Files answered 27/12, 2010 at 16:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.