Class Veery

veeryDidReceiveNewLocations(_ veery: Veery, newLocations: [CLLocation])

Delegate triggered when the user has moved. You should implement VeeryDelegate in your ViewController to use it.

Your are warned only if you are called the requestLocationUpdate() and the activate(service : Int) with a service higher than Veery.DEACTIVATE_ALL.

This could be used to refresh a Map

To stop the location update you shoud call stopLocationUpdate().

Parameters

Param name Type Usage
veery Veery none
newLocation [CLLocation] The last Location

Returns

none

Usage / Example

import Foundation
import UIKit
import Veery

class ViewController: UIViewController, VeeryDelegate {// Implement Veery Delegate

    // TODO : Inside the principal class (!!not inside a function)
    let veery = Veery()

     override func viewDidLoad() {
        super.viewDidLoad()
        // TODO : Init the delegate
        veery.delegate = self
        // TODO : declare your API Key Secret
        veery.setApiKeySecret("SuPeRScrET12345789GhJ")

        // TODO : Activate the required function levels (user will be requested to accept geolocation)
                    veery.activate(service: Veery.GEOPROFILE)
                    // Requires ios Veery 1.3.3
                    //veery.activate(service:Veery.BACKGROUND_GEOLOC  | Veery.COLLECT | Veery.ROUTE_MATCH | Veery.POINT_OF_INTEREST | Veery.PREDICTION)


        veery.requestLocationUpdate()

    }

    func veeryDidReceiveNewLocations(_ veery: Veery, newLocations: [CLLocation]) {

                // refresh your Map

                // do whatever you need with the Location object

    }

    @IBAction func stopLocation(_ sender: Any) {
        veery.stopLocationUpdate()
    }


}

User interaction

none

See also

getCurrentLocation()

Get the last known Location collected by Veery.

requestLocationUpdate()

Request Veery to be warned when the user has moved.

stopLocationUpdate()

Cancel the call to requestLocationUpdate.

veeryDidReceiveNewLocations

Delegate triggered when the user has moved.