From the course: iOS and watchOS App Development: Notifications

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Image attachment

Image attachment

From the course: iOS and watchOS App Development: Notifications

Start my 1-month free trial

Image attachment

- [Instructor] To add media, there's a property attachment that takes an array of UN notification attachments, except it only allows one element in the array. So let's go back into viewcontroller.swift here, and I'm going to go over to schedule pizza again, which I'm already in, and find all my content, and so we can add a content attachments to this, and I'm going to put another category identifier here. Content attachments equals, and you get an array, and we're going to put an attachment. And I'm going to click out of here so that it doesn't have problems with AutoCorrect, 'cause we've got an unresolved identifier. Now I'm going to go backwards on this, which is where we get a lot of unresolved identifiers as I do this, and so I've created an identifier attachment which is going to be our attachment. Now on the line above that, I'm going to assign that to a UN notification attachment initializer. So I'm going to call this let attachment equal, and this initializer actually is…

Contents