From the course: iOS and watchOS App Development: Notifications

Unlock the full course today

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

Static notification content

Static notification content

From the course: iOS and watchOS App Development: Notifications

Start my 1-month free trial

Static notification content

- [Instructor] The content of a notification is text and graphics you find within the notification. The two most important pieces of content are the title and body, though there are many others. Let's look at a simple example first. Head back up to our schedulePizza and makePizza. And, where we have self.introNotification, comment that out on both of those. And then, in the scheduled, underneath that, I'll add the content directly in the method, using the UNMutableNotificationContent object. So, I'm just going to make this object. I'm just going to call it content. You can only add using the mutable. There is another one called UNNotificationContent, which we'll get to a little later, but for now, we're only worried about the mutable, 'cause that's the one you can actually change the content to. Now, this has a lot of different properties. You can go ahead and type content here. Hit dot, and you'll see several type of content you can use. The two most basic are the title, and that's a…

Contents