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

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -