update old and new location to firebase with swift -


i building app multiple users show on map avatar , trying animate movement on map need old , new location that, can't old location , don't know how . used code update new location still need old 1 :

func locationmanager(manager: cllocationmanager, didupdatelocations locations: [cllocation]) {  if let location = locations.first { self.database.database().reference().child("location").child(auth.auth()!.currentuser!.uid).setvalue(["newlatitude": locationmanager.location!.coordinate.latitude, "newlongitude": locationmanager.location!.coordinate.longitude]) }  } 

thanks in advance


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -