So I need to store the user's location coordinates in a database. So far i have created a viewcontroller.swift that has the database but I have mapkit attached to another viewcontroller where it prints out the coordinates. I was wondering how to get those coordinates and store on the database created in my first view controller.
Prints coordinates
func locationManager(_ manager: CLLocationManager, didUpdateLocations
locations: [CLLocation]) {
if let location = locations.first{
print(location.coordinate)
}
Need to input here
let building = buildingField.text?.trimmingCharacters(in:
.whitespacesAndNewlines)
if(building?.isEmpty)!{
print("Building is Empty")
}
if sqlite3_bind_text(stmt, 5, building, -1, nil) != SQLITE_OK{
print("Error binding building")
}