Created
December 3, 2017 16:09
-
-
Save nderkach/8e4e99a18a446f4e3c62bbbf42c80990 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func updateLocation(_ location: CLLocation) { | |
| if let uid = Auth.auth().currentUser?.uid { | |
| let latitude = location.coordinate.latitude + (Double(arc4random()) / Double(UINT32_MAX) / 10 - 0.05) | |
| let longitude = location.coordinate.longitude + (Double(arc4random()) / Double(UINT32_MAX) / 10 - 0.05) | |
| self.ref.child("users/\(uid)/location").setValue(["lat": latitude, "lon": longitude]) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment