4

I have the following code:

func sendLucidNotification() {
    let content = UNMutableNotificationContent()
    content.title = "10 Second Notification Demo"
    content.subtitle = "From MakeAppPie.com"
    content.body = "Notification after 10 seconds - Your pizza is Ready!!"
    content.categoryIdentifier = "message"

}

When I call, UNMutableNotificationContent, or any "UNMutableNotification" variation I get the following error:

Use of unresolved identifier: "UNMutableNotificationContent"

I'm on Xcode 8.0, but when I try autocompleting it doesn't recognize it either. Any ideas ? Thank you!

kb920
  • 3,039
  • 2
  • 33
  • 44
ZB-dev
  • 219
  • 3
  • 12

1 Answers1

20

Most probably you need to add the import notification_framework statement where you have written this code e.g

import notification_framework_name

Also make sure the framework is available for your target build.

Update: in your case the import statement would be :

import UserNotifications
Tushar
  • 3,022
  • 2
  • 26
  • 26