Summary and hidden text (iOS 12)

Open the AppDelegate file and let's add a couple of things to the permissionGranted() method. Add the following under the let optionTwo constant:

// Add this under optionTwolet hiddenRestaurantPlaceholder = "%u new restaurant invites."let summaryFormat = "%u more restaurant invites for %@"

Next, delete the let category constant and replace it with the following:

let category = UNNotificationCategory(identifier:Identifier.reservationCategory.rawValue, actions:[optionOne,optionTwo], intentIdentifiers: [], hiddenPreviewsBodyPlaceholder: hiddenRestaurantPlaceholder, categorySummaryFormat: summaryFormat, options:[])

Your permissionGranted() method should now look like the following:

func permissionGranted() { ...

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.