When building iOS apps, data can be the most important part. Typically, the apps you build require getting data from an online data source, known as an Application Programming Interface (API). In the previous chapters, we have only worked with a plist
to supply our data. The plist
bridges the gap to understanding how to work with an API, as you will see shortly. In this chapter, we will work with an API that is in JavaScript Object Notation (JSON) format. This format is common no matter which backend service was used to create the JSON. In this chapter, we will cover:
What a JSON file is and the different components of this data feed
Passing data using segues
What extensions are and how to use them to clean up your code
For our app, we need one class to handle our data, but we need to share it between both our Explore View Controller and Map View Controller. Let's first understand the responsibility of our API Manager.