April 2020
Beginner
316 pages
8h 20m
English
Within our mock data, we've been using a predefined country to look up our flag images. We'll also use this later on in the project too, making it a mandatory field that we'll need to add to our AddRecipeView.
First, we'll start by creating some mock data. Head on over to Helper.swift and create the following helper function:
static func getCountries() -> [String] { return ["Italy", "Greece", "UK", "China", "France", "USA", "Mexico", "Spain"]}
For the purpose of this book, I've only added a few random countries, but you can add as many as you want. Next, head over to AddRecipeView.swift and create another Section(). This time called it "Country of Origin:":
Section(header: Text("Country of Origin:")) {}
Next, we'll ...
Read now
Unlock full access