我正在將分析推送通知集成到應用程序中,並且陷入Swift 2.0轉換。 代碼是:將分析推送通知集成到Xcode 7項目中(Swift)
if application.respondsToSelector("registerUserNotificationSettings:") {
let userNotificationTypes: UIUserNotificationType = [.Alert, .Badge, .Sound]
let settings = UIUserNotificationSettings(forTypes: userNotificationTypes, categories: nil)
application.registerUserNotificationSettings(settings)
application.registerForRemoteNotifications()
} else {
let types: UIUserNotificationType = [.Badge, .Alert, .Sound]
application.registerForRemoteNotificationTypes(types)
}
Xcode中抱怨說,「無法將類型的價值‘UIUserNotificationType’預期參數類型‘UIRemoteNotificationType’