问题 In iOS 10 , there is an option for presenting the notification when the app is in foreground using UNNotificationPresentationOptions , but i couldn't find any sample on how to use this, please suggest some idea about how to implement this feature 回答1: I have implemented the foreground notification by Adding the below code in my viewController extension UIViewController: UNUserNotificationCenterDelegate { public func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent