Attaches arbitrary content to the message.
SDKs
- iOS 7.0+
- Mac Catalyst 13.0+
Framework
- Message
UI
Declaration
Parameters
attachmentData
Content in the form of an
NSData
object to attach to the message. Must not benil
.uti
A valid Uniform Type Identifier (UTI) appropriate for the attachment data. See Uniform Type Identifiers Reference. Must not be
nil
.filename
The name to present to the user, in the message UI, for the data attachment.
Return Value
true
if the attachment data was successfully added to the message, or false
otherwise.
Discussion
This method is especially useful when the attachment you want to add to a message does not have a file system representation. This can be the case, for example, for programmatically composed audiovisual content.