Skip to content

Instantly share code, notes, and snippets.

@andrewxhill
Created March 29, 2017 23:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewxhill/c52a8d028d9be31e5ee21b9c3d409d54 to your computer and use it in GitHub Desktop.
Save andrewxhill/c52a8d028d9be31e5ee21b9c3d409d54 to your computer and use it in GitHub Desktop.
// departure subscription
SetSDK.instance.onDeparture(.home) { departure in
// on departure, predict their likely destination
if let destinations = SetSDK.instance.getDestination(fromLocation: departure.location, fromTimestamp: departure.date), let destination = destinations.first {
// Process the top destination predictions
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment