UNNotificationAttachment
extension UNNotificationAttachment
Creates an attachment for the data at URL with an optional options dictionary. URL must be a file URL. Returns nil if the data at URL is not supported.
-
Convenience init for
UNNotificationAttachmentthat accepts an imageData, saves the image on a temporary directory on the device, then returns aUNNotificationAttachmentwith the said image.Declaration
Swift
public convenience init(identifier: String, data: Data, options: [NSObject : AnyObject]? = nil) throwsParameters
identifierFilename that will be used when storing the image
dataImage data
optionsA dictionary of options related for the file that will be created
Return Value
The created
UNNotificationAttachmentwith an image.
View on GitHub
UNNotificationAttachment Extension Reference