Instance Method

filenameExtension(_:isValidForType:)

Returns whether the specified filename extension is appropriate for the Uniform Type Identifier (UTI).

Declaration

func filenameExtension(_ filenameExtension: String, isValidForType typeName: String) -> Bool

Parameters

filenameExtension

A string containing the filename extension.

typeName

A string containing the UTI.

Return Value

true if fileNameExtension is a valid extension for typeName; otherwise, false.

Discussion

You can safely call this method from any thread of your app.

See Also

Manipulating Uniform Type Identifier Information

func type(ofFile: String) -> String

Returns the uniform type identifier of the specified file, if it can be determined.

func localizedDescription(forType: String) -> String?

Returns the localized description for the specified Uniform Type Identifier (UTI).

func preferredFilenameExtension(forType: String) -> String?

Returns the preferred filename extension for the specified Uniform Type Identifier (UTI).

func type(String, conformsToType: String) -> Bool

Returns a Boolean indicating that the first Uniform Type Identifier (UTI) conforms to the second UTI.

func urlForApplication(withBundleIdentifier: String) -> URL?

Returns the URL for the app with the specified identifier.