0
我有下面的代码不是0:mapView.annotations.count是迅速
@IBAction func countAnnotations(sender: AnyObject) {
print("Annotations Count = \(mapView.annotations.count)")
if mapView.annotations.count == 0 {
print("No annotations")
}else{
print("1 or more annotations")
}
}
这是为了检查有多少注释是在我的地图视图。
的问题,当我开始使用下面的代码检索用户的位置出现了:
func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
//Update the current location
currentLocation = manager.location!.coordinate
print("locations = \(currentLocation.latitude) \(currentLocation.longitude)")
}
出于某种原因,这似乎算作一个注解。我如何检测实际注释是否被放置?
要显示用户位置还是应该隐藏? –
我希望用户位置在可能的情况下始终可见。 –
凹凸?仍然需要一些帮助! –