Instance Property

fileType

The name of the document type, as specified in the app’s Info.plist file.

Declaration

var fileType: String? { get set }

Discussion

The document type affects how the data is filtered when it is written to or read from a file. When a document is saved, the type is determined by the entries in the app’s information property list (specified in Info.plist).

You cannot use this property to change the document’s format after it has already been opened or saved. This property records only the initial document format used when first opening or saving the file.

See Also

Managing File Types

var fileTypeFromLastRunSavePanel: String?

The file type that was last selected in the Save panel.

class func isNativeType(String) -> Bool

Returns a Boolean value indicating whether document data of the specified type is a native type—one the receiver can both read and write.

class var readableTypes: [String]

Returns the types of data the receiver can read natively and any types filterable to that native type.

class func canConcurrentlyReadDocuments(ofType: String) -> Bool

Returns a Boolean value indicating whether the receiver reads multiple documents of the given type concurrently.

class var writableTypes: [String]

Returns the types of data the receiver can write natively and any types filterable to that native type.

func writableTypes(for: NSDocument.SaveOperationType) -> [String]

Returns the names of the types to which this document can be saved for a specified kind of save operation.

func fileNameExtension(forType: String, saveOperation: NSDocument.SaveOperationType) -> String?

Returns a filename extension that can be appended to a base filename, for a specified file type and kind of save operation.