init(contentsOfFileAtURL:uniformTypeIdentifier:)
Creates an attachment from the contents of an existing file on disk, with a custom UTI.
Declaration
convenience init(contentsOfFileAtURL url: URL, uniformTypeIdentifier identifier: String)Parameters
- url:
The file URL from which data should be read to create the new attachment.
- identifier:
A custom UTI to represent the file’s content type.
Discussion
The attachment’s name property is the file name of the provided url.