转换为 Swift 3 - 通知中心调度队列
Convert to Swift 3 - Notification Centre dispatch queue
正在努力将其转换为 Swift 3. 你能帮忙吗?
dispatch_async(dispatch_get_main_queue()) { () -> Void in
self.delegate.locationDidUpdateToLocation(self.currentLocation!)
NSNotificationCenter.defaultCenter().postNotificationName(kLocationDidChangeNotification, object: self, userInfo: userInfo as [NSObject : AnyObject])
}
非常感谢!
我不确定委托方法是什么,但它的其余部分看起来像这样:
DispatchQueue.main.async {
NotificationCenter.default.post(name: notification_name, object: self, userInfo:userInfo )
}
我不确定kLocationDidChangeNotification
正在努力将其转换为 Swift 3. 你能帮忙吗?
dispatch_async(dispatch_get_main_queue()) { () -> Void in
self.delegate.locationDidUpdateToLocation(self.currentLocation!)
NSNotificationCenter.defaultCenter().postNotificationName(kLocationDidChangeNotification, object: self, userInfo: userInfo as [NSObject : AnyObject])
}
非常感谢!
我不确定委托方法是什么,但它的其余部分看起来像这样:
DispatchQueue.main.async {
NotificationCenter.default.post(name: notification_name, object: self, userInfo:userInfo )
}
我不确定kLocationDidChangeNotification