tanjyy / ridesio

Ridesharing iOS application for college students. Won 2nd place in the iOS category at CodePath Demo Day 2020.
https://tanjyy.github.io/ridesio
1 stars 1 forks source link

Add address/location API to create ride offerings #81

Closed yaosarayin closed 3 years ago

nashirj commented 3 years ago

check out #14 for Taha's research on this

nashirj commented 3 years ago

I think the Yelpy project also has some information on this

nashirj commented 3 years ago

https://stackoverflow.com/questions/33380711/how-to-implement-auto-complete-for-address-using-apple-map-kit

nashirj commented 3 years ago

Next thing to do after creating a new modal screen for populating the text field with the result of the above, is to set up a delegate to retrieve the information computed in the modal screen: follow these instructions

nashirj commented 3 years ago

Code for getting the distance of the ride in miles

import CoreLocation

let coordinate₀ = CLLocation(latitude: 5.0, longitude: 5.0)
let coordinate₁ = CLLocation(latitude: 5.0, longitude: 3.0)

let distanceInMeters = coordinate₀.distance(from: coordinate₁) // result is in meters
let milesPerMeter = 0.000621371192
let distanceInMiles = distanceInMeters * milesPerMeter