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
Post a Comment