April 2020
Beginner
316 pages
8h 20m
English
The first thing we need to do is create a couple of additional functions in our Helper() class in order to perform a latitude and longitude lookup for our RecipeModel().origin property.
Now, there's quite a bit here to type out, so you might just want to grab this from the sample project and copy it into yours.
We'll start by adding in a private function called getCoordinates. This function accepts a String parameter, which will be the country name:
private static func getCoordinates(country: String) -> CLLocationCoordinate2D { switch country { case "Italy": return CLLocationCoordinate2D(latitude: 43.112221, longitude: 12.388889) case "Greece": return CLLocationCoordinate2D(latitude: 37.983810, longitude: 23.727539) ...Read now
Unlock full access