Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. In Xcode File > New > Target...

  2. Select Notification Content Extension then press Next.

  3. Enter the product name as NotificationContent and press Finish.

  4. Do not select Activate on the dialog that is shown after selecting Finish.

    By canceling, you are keeping Xcode debugging your app, instead of the extension you just created.

    If you activated by accident, you can switch back to debug your app within Xcode (next to the play button).

  5. In the project navigator, select the top-level project directory and select the NotificationContent target in the project and targets list. Unless you have a specific reason not to, you should set the Deployment Target to be iOS 11.

  6. Delete MainInterface.storyboard and NotificationContent.swift files. Then create a swift file named EMNotificationViewController under the NotificationContent folder.

    Don't Create Objective-C Bridging Header

    Image Added

  7. Open EMNotificationViewController.swift and replace the whole file's contents with the following code

...