I hope someone can guide me...I know Swift 2.0/ Xcode 7 still in beta but I need to convert my code... Here is my code...
func application(application: UIApplication, didReceiveRemoteNotification userInfo: [NSObject : AnyObject]) {
let notification:CKNotification = CKNotification(fromRemoteNotificationDictionary: userInfo)
//application.applicationIconBadgeNumber = 0
if (notification.notificationType == CKNotificationType.Query) {
let queryNotification = notification as! CKQueryNotification
let recordID = queryNotification.recordID
receivedRecord = recordID
NSNotificationCenter.defaultCenter().postNotificationName("updateDatabase", object: nil)
}
}
So the expected Dict for CKNotification has changed to [String:NSObject] -> before was [NSObject:AnyObject] which conformed to the returned Dict! and the returned Dict from the function(didReceiveRemoteNotification) is: [NSObject : AnyObject]
Taken from Xcode 7 -> public convenience init(fromRemoteNotificationDictionary notificationDictionary: [String : NSObject])
Taken from Xcode 6.4 -> convenience init!(fromRemoteNotificationDictionary notificationDictionary: [NSObject : AnyObject]!)
So, my question is, how could I convert this or do I miss something obvious? Might this be a bug?
Thanks for any guidance/ help...