init(contentsOfFileAtURL:)
Creates an attachment from the contents of an existing file on disk.
Declaration
convenience init(contentsOfFileAtURL url: URL)Parameters
- url:
The file URL from which data should be read to create the new attachment.
Discussion
The attachment’s name property is the file name of the provided url. The attachment’s uniformTypeIdentifier value is inferred from the file’s extension. A default UTI of "public.data" is used for files without an extension.