Can a ZipFoundation Archive be sent as data in a mail attachment?

64 Views Asked by At

I need to zip up some logs and send them as a mail attachment

MFMailComposeViewController has a method for attachments func addAttachmentData(_ attachment: Data, mimeType: String, fileName filename: String)

But it only accepts a Data object. Is there an easy way to get the Data of the archive directly, or do I need to save to file, then read the data from file, then delete the file?

1

There are 1 best solutions below

0
Wowbagger and his liquid lunch On BEST ANSWER

according to this pull request, ZIPFoundation will have support for Data type in the next release.