Swift 4.2 Reduce and CoreLocation: Total Distance Traveled πŸš—

Kewin
5 min readFeb 9, 2019

In a recent project I came across a problem that I am very sure many other developers face: Calculating the total distance between locations stored in a list. Imagine, for instance, that you have a custom route on a map represented by a list of CLLocation objects. How do you calculate the total length of the route from the CLLocation objects alone?
The math behind it is simple and…

--

--

Kewin

Lead iOS Engineer @ Jabra πŸ‡©πŸ‡° Full time πŸ’»πŸ“² β€” part time β€πŸŠπŸΌπŸš΄πŸΌπŸƒπŸ»β›·βš½οΈ