Initializer

init(forOpeningFilesWithContentTypes:)

Initializes and returns a document browser view controller that can open the given file types.

Declaration

init(forOpeningFilesWithContentTypes allowedContentTypes: [String]?)

Parameters

allowedContentTypes

An array of uniform type identifiers (UTIs). The document browser can open only the document types specified by these UTIs. If you pass nil, the browser uses the document types specified by the CFBundleDocumentTypes key in the app’s Info.plist file.

For detailed instructions on setting the CFBundleDocumentTypes key, see Set the Supported Document Types.

For more information about UTIs, see Uniform Type Identifiers Reference.

Return Value

Returns a newly initialized document browser view controller.

See Also

Creating a Document Browser

Adding a Document Browser to Your App

Give users access to their local or remote documents from within your app.