I tried to convert my objective C AppDelegate to Swift AppDelegate. So I deleted the main.m file and Converted all the AppDelegate code to swift. I tried to run the project, then this error occurs.
Cannot find protocol declaration for 'UNUserNotificationCenterDelegate'
In the -Swift.h file they generate, this is the delegate they showed
- (void)userNotificationCenter:(UNUserNotificationCenter * _Nonnull)center willPresentNotification:(UNNotification * _Nonnull)notification withCompletionHandler:(void (^ _Nonnull)(UNNotificationPresentationOptions))completionHandler SWIFT_AVAILABILITY(ios,introduced=10.0);
This is how I have written
@available(iOS 10.0, *)
func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, withCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) {
handleNotification(notification.request.content.userInfo)
}
Please help me get what is the issue am facing.
I tried, cleaning, restarting Xcode and restarting my Mac. Am using Swift 3.2.
This is my -Swift.h file error
If I comment the delegates, there are no errors.