【发布时间】:2015-06-03 13:20:29
【问题描述】:
在 Objective C 中,我得到了用户的旧位置和新位置 使用以下方法
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
if (oldLocation == nil) return;
BOOL isStaleLocation = ([oldLocation.timestamp compare:self.startTimestamp] == NSOrderedAscending);
...
}
现在我将代码移植到 Swift,我无法通过以下方法获取旧位置
func locationManager(manager: CLLocationManager!, didUpdateLocations locations: [AnyObject]!) {
self.currentLocation = manager.location
}
有什么办法可以得到旧位置还是我错过了什么?
【问题讨论】:
标签: ios swift cocoa-touch core-location cllocationmanager