I am trying to get pending notification request on local notification. It throws me error: "Invalid conversion from throwing function of type '(_) throws -> Void' to non-throwing function type '([UNNotificationRequest]) -> Void' "
My code is:
var notificationTitle = "\(String(describing: notificationData!["title"]))"
var notificationInterval: Int = notificationData!["interval"] as! Int
let center = UNUserNotificationCenter.current()
center.getPendingNotificationRequests(completionHandler: {(requests) -> Void in
var notificationExist:Bool = false
for notificationRequest in requests {
try{
var notificationContent:UNNotificationContent = notificationRequest.content
}
}