Contents

writeFileContents(_:)

Writes the contents of the specified file to the pasteboard.

Declaration

func writeFileContents(_ filename: String) -> Bool

Parameters

  • filename:

    The name of the file to write to the pasteboard.

Return Value

true if the data was successfully written, otherwise false.

Discussion

Writes the contents of the file filename to the receiver and declares the data to be of type NSFileContentsPboardType and also of a type appropriate for the file’s extension (as returned by the NSCreateFileContentsPboardType function when passed the files extension), if it has one.

See Also

Related Documentation

Writing data (macOS 10.5 and earlier)