私は私のビューでは、マップの基本的な設定を持って、私はピンをアニメーションドロップするようにしようとしている...ちょうど&を押して、ロケーション。だから私がビューに入ると、すべてのピンがその位置へのドロップをアニメートし、私は実際にそれを行う方法を知らない。誰かが私を正しいコードに導くことができるなら、それを追加する必要があります。マップピンをアニメートする方法は?スウィフト2.2 IOS 9
class FirstViewController: UIViewController,MKMapViewDelegate, CLLocationManagerDelegate{
@IBOutlet weak var mapView: MKMapView!
let locationManager = CLLocationManager()
override func viewDidLoad() {
super.viewDidLoad()
self.locationManager.delegate = self
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest
self.locationManager.requestWhenInUseAuthorization()
self.locationManager.startUpdatingLocation()
self.mapView.showsUserLocation = true
let LitzmanLocation = CLLocationCoordinate2DMake(32.100668,34.775192)
// Drop a pin
let Litzman = MKPointAnnotation()
Litzman.coordinate = LitzmanLocation
Litzman.title = "Litzman Bar"
Litzman.subtitle = "Nemal Tel Aviv St'"
mapView.addAnnotation(Litzman)}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
//Dispose of resources that can be re created.
}
//Mark:
func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation])
{
let location = locations.last
let center = CLLocationCoordinate2D(latitude: location!.coordinate.latitude, longitude: location!.coordinate.longitude)
let region = MKCoordinateRegion(center: center, span: MKCoordinateSpan(latitudeDelta: 0.1, longitudeDelta: 0.1))
self.mapView.setRegion(region, animated: true)
self.locationManager.stopUpdatingLocation()
}
func locationManager(manager: CLLocationManager, didFailWithError error: NSError)
{
print("Errors: " + error.localizedDescription)
}
以下のようがdidBecomeActiveにをregionDidChangeAnimatedことを最後に変更 - そうそれはあなたを助けるのが難しいだろう – AlBlue
@AIBlueあなたはどこですか? –