Swift 3更新位置注释
例如,这个红色指针的坐标现在是:51.507222,-0.1275。我想换一下这张照片的底片。我该怎么做Swift 3更新位置注释,swift,swift3,mapkit,Swift,Swift3,Mapkit,例如,这个红色指针的坐标现在是:51.507222,-0.1275。我想换一下这张照片的底片。我该怎么做 class Capital: NSObject, MKAnnotation { var title: String? var coordinate: CLLocationCoordinate2D var info: String init(title: String, coordinate: CLLocationCoordinate2D, info: Str
class Capital: NSObject, MKAnnotation {
var title: String?
var coordinate: CLLocationCoordinate2D
var info: String
init(title: String, coordinate: CLLocationCoordinate2D, info: String) {
self.title = title
self.coordinate = coordinate
self.info = info
}
}
let london = Capital(title: "London", coordinate: CLLocationCoordinate2D(latitude: 51.507222, longitude: -0.1275), info: "Home to the 2012 Summer Olympics.")
@IBOutlet weak var mapView: MKMapView!
override func viewDidLoad() {
super.viewDidLoad()
mapView.addAnnotations([london])
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
能否添加所需内容的更多详细信息。如果要更改坐标
london.coordinate=newLocation