Alright, so the key here is I\'m not using IB at all, because the View I\'m working with is created programmatically. The UIView covers the lower half the scre
Calculate distance between 2 point on maps for iOS [closed]
import UIKit import CoreLocation
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
var myLocation = CLLocation(latitude: 23.1929, longitude: 72.6156)
var myBuddysLocation = CLLocation(latitude: 23.0504, longitude: 72.4991)
var distance = myLocation.distance(from: myBuddysLocation) / 1000
print(String(format: "The distance to my buddy is %.01fkm", distance))
}
}