Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/120.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 转换为Swift 3-通知中心调度队列_Ios_Swift2_Swift3 - Fatal编程技术网

Ios 转换为Swift 3-通知中心调度队列

Ios 转换为Swift 3-通知中心调度队列,ios,swift2,swift3,Ios,Swift2,Swift3,正在努力将其转换为Swift 3。你能帮忙吗 dispatch_async(dispatch_get_main_queue()) { () -> Void in self.delegate.locationDidUpdateToLocation(self.currentLocation!) NSNotificationCenter.defaultCenter().postNotificationName(kLocationDidChangeNotification, obj

正在努力将其转换为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

是否有效!必须承认,对NotificationCenter上的所有更改非常困惑,有这么多版本,但似乎没有一个是正确的!