Last active
August 16, 2016 12:46
-
-
Save janodev/afb59d04c406b1719dbcea313134636e to your computer and use it in GitHub Desktop.
Create a notification with an image attachment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let content = UNMutableNotificationContent() | |
content.title = "Will it rain?" | |
content.body = "It never rains in (Southern) California!" | |
content.sound = UNNotificationSound.default() | |
let url = URL(string: "https://67.media.tumblr.com/ab04c028a5244377a0ab96e73915e584/tumblr_nfn3ztLjxk1tq4of6o1_400.gif") | |
let attachment = try! UNNotificationAttachment(identifier: "image", url: url!, options: nil) | |
content.attachments = [attachment] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment