Embedding images (iOS 10 feature)

Next, let's embed our images. First, return to the RestaurantDetailViewController.swift file and, in the showNotification() method we created, remove the following code:

let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 5, repeats: false)let identifier = "letsEatReservation"let request = UNNotificationRequest(identifier: identifier, content: content, trigger: trigger)UNUserNotificationCenter.current().add(request, withCompletionHandler: { error in   // handle error})

Replace the deleted section of code with the following code:

guard let imgURL = Bundle.main.url(forResource: "sample-restaurant-img@3x", withExtension:"png") else { return }let attachment = try! UNNotificationAttachment(identifier

Get iOS 12 Programming for Beginners - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.