Finding user's current location with Parse and saving it in the Parse database

173 views Asked by At

Sorry this is a newbie question. I've followed the Parse documentation on PFGeopoints but I don't think I'm getting it right. Where should I put this line: placeObject["location"] = point

My goal is to: 1. Find CURRENT ADDRESS of the USER. 2. Show location with a pin on a the map and written on a label. 3. Transfer the user's address to Parse

Please help!

Here's the code:

import UIKit
import Parse
import MapKit
import CoreLocation
class ViewController: UIViewController, MKMapViewDelegate, CLLocationManagerDelegate {
    @IBOutlet var map: MKMapView!
    let point = PFGeoPoint(latitude:40.0, longitude:-30.0)
    override func viewDidLoad() {
        super.viewDidLoad()
        PFGeoPoint.geoPointForCurrentLocationInBackground {
            (geoPoint: PFGeoPoint?, error: NSError?) -> Void in
            if error == nil {
            }
        }
    }
}
0

There are 0 answers