func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool方法里
NSDictionary *userInfo = [launchOptions valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; 这句话怎么转化为swift呢
这样 let dic = launchOptions as! NSDictionary转化 会有警告。
直接这样写let userInfo = launchOptions(valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey)又不行
NSDictionary *userInfo = [launchOptions valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey]; 这句话怎么转化为swift呢
这样 let dic = launchOptions as! NSDictionary转化 会有警告。
直接这样写let userInfo = launchOptions(valueForKey:UIApplicationLaunchOptionsRemoteNotificationKey)又不行
解决方案:30分
let userInfo = launchOptions?[UIApplicationLaunchOptionsRemoteNotificationKey]