“Cannot convert return expression of type 'Void' to return type 'Bool'” How to solve it?
As you can see, the method application(_:didFinishLaunchingWithOptions:) is declared with ->Bool, which means you need to return a Bool value from the method. In case of application(_:didFinishLaunchingWithOptions:), it should be true usually.
One more, please use the Code block feature (icon <> below the editing area) when you show some code as text.
Code Block func application(_ application:UIApplication,didFinishLaunchingWithOptions launchOptions:[UIApplication.LaunchOptionsKey:Any]?) -> Bool { UNUserNotificationCenter.current().requestAuthorization(options: [.alert,.sound,.badge]){(granted,error)in if granted { print("User notifications are allowed.") } else { print("User notifications are not allowed.") } } return true //<- } //End `application(_:didFinishLaunchingWithOptions:)`
One more, please use the Code block feature (icon <> below the editing area) when you show some code as text.