CLLocationMiddleManager lets you spoof location information on devices just like the Simulator does.
Simply replace
let locationManager = CLLocationManager()
with
let locationManager = CLLocationMiddleManager(file: "my_gpx_route")
and it should all just workTM.
CLLocationMiddleManager is Carthage-compatible.
github "Shrugs/CLLocationMiddleManager" >= 1.0
Ignore the warnings about a directory, not sure what's up with those.
CLLocationMiddleManager works by interpreting a gpx
file that's included in your app's bundle.
<time>
keys to each wpt
.
<wpt lat="42.357542" lon="-83.059571"><time>2015-09-13T14:19:35Z</time></wpt>
yyyy-MM-ddTHH:mm:ssZ
2015-09-13T14:19:35Z
is a valid time
let demoMode = true // this can be a Compiler Flag or anything you want
let locationManager = demoMode ? CLLocationMiddleManager(file: "my_gpx_route") : CLLocationManager()
And tada, you're spoofing location on device. Woo!