Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private func processLocation(_ current:CLLocation) {
- guard let location = lastLocation else {
- lastLocation = current
- speed.value = 0
- return
- }
- var speed = current.speed
- if (speed > 0) {
- speed.value = speed
- } else {
- speed = location.distance(from: current) / (current.timestamp.timeIntervalSince(location.timestamp))
- speed.value = speed
- }
- lastLocation = current
- }
- Speed: 0.249200397696353
- Speed: 0.778375328912623
- Speed: 6.99212664940017 -> peak
- Speed: 4.91809055561385 -> peak
- Speed: 0.701735999364708
- Speed: 0.025146066057472
- Speed: 0.0233857682731226
- Speed: 12.7814687721084 -> peak
- Speed: 0.61632553168542
- Speed: 7.37520678279276 -> peak
- Speed: 0.023421072500409
- Speed: 0.0343784939631481
- Speed: 0.471982071125438
- Speed: 0.0207671001927932
- Speed: 0.0217459598583271
- Speed: 0.0394697185852203
- Speed: 0.439568634647097
- Speed: 14.1348693612176 -> peak
- Speed: 6.29588775714151 -> peak
- Speed: 5.55254459904619 -> peak
- Speed: 0.218587071425142
Add Comment
Please, Sign In to add comment