Let's review how our app will work. A user will select a cuisine and location. Then, the location will be passed to the Explore View. The user will get restaurants from the selected location filtered by the selected cuisine.
If this were online, we would pass the location to the API, and the API would return the JSON data. As you can see, we are doing the same. When you eventually deal with an API, the transition of working with online data will be seamless.
Therefore, as stated earlier, in order to get data, we need a location. In order to get the location, we need to get it from the LocationViewController
. When a location is selected, we will show a checkmark. We will need this checkmark to update each time a new item is set. Finally, when the Done
button is tapped, we need to pass this location to ExploreViewController
.
Let's update our LocationViewController
first. We need a variable to keep track of the selected location. Add the following inside the LocationViewController...