我需要使用哪种代码才能使我的条形按钮找到并缩放到用户的位置,就像在Google地图中一样?我尝试了以下方法:
if Navigationbutton != nil {
Navigationbutton.target = MKMapView()
Navigationbutton.action = CLLocationCoordinate2D (latitude: location!.coordinate.latitude, longitude: location.coordinate.longitude)
答案 0 :(得分:1)
我认为您正在寻找的是MKUserTrackingBarButtonItem! https://developer.apple.com/library/ios/documentation/MapKit/Reference/MKUserTrackingBarButtonItemClassRef/