UNUserNotificationCenterDelegate 委托方法 "nearly matches optional requirement"
UNUserNotificationCenterDelegate delegate method "nearly matches optional requirement"
我正在实施
func userNotificationCenter(_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: () -> Void) {
但是我收到编译器的 "nearly matches optional requirement" 警告。我的声明有什么问题?我直接从文档中复制了它!
这是 @escaping
属性。它没有显示在文档中。但是它是显示在header。这就是复制的地方!这是正确的声明:
func userNotificationCenter(_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void) {
我正在实施
func userNotificationCenter(_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: () -> Void) {
但是我收到编译器的 "nearly matches optional requirement" 警告。我的声明有什么问题?我直接从文档中复制了它!
这是 @escaping
属性。它没有显示在文档中。但是它是显示在header。这就是复制的地方!这是正确的声明:
func userNotificationCenter(_ center: UNUserNotificationCenter,
didReceive response: UNNotificationResponse,
withCompletionHandler completionHandler: @escaping () -> Void) {