Get User's Coordinates Setup

PHOTO EMBED

Sun Jun 06 2021 15:38:01 GMT+0000 (UTC)

Saved by @joeavargas

// Get user's GPS coordinates
    func getUserCoordinates(){
        if let coordinates = locationManager.location?.coordinate{
            print("Latitude: \(coordinates.latitude), Longitude: \(coordinates.longitude)")
            
            // Implement network request passing in user's coordinates
            DispatchQueue.main.async {
                // Setup UI
            }
        } else {
            // print "unable to get coordinates
        }
    }
content_copyCOPY