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.
Add the framework
From the course: iOS and watchOS App Development: Notifications
Add the framework
- [Instructor] Before you start adding code for user notifications, you must import the framework UserNotifications. In our app I'm going to do this in three places. Let's start on the ViewController.swift file, just under import UIKit put import UserNotifications. Then I'm going to go to ManageNotificationsViewController.swift and I'm going to do the same thing. Now you may be seeing up here errors, just like the one that popped up here and you can see there's a lot of 'em. And that's because of the import itself, it needs that. I've used some of the code here has some user notification stuff already here and I need this to get rid of all that. So import UserNotifications and finally I'm going to do it up in the AppDelegate, import UserNotifications. Alright, now we can see if it works here. I'm going to use a very important part of the user notifications framework. So I'm going to go down here to application didFinishLaunchingWithOptions and before the return true I have to make a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.