我正在将分析推送通知集成到应用程序中,并且陷入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’