Consuming API in App

In the previous chapter, we learned how to route requests, how to use controllers, and how to make RESTful routes for our models that will persist data into the MongoDB database. In this chapter, we will consume the API routes we just created in our Shopping List iOS app. Most modern iOS applications need to communicate with a server to fetch data to show on the app. They also update data on the server so that you can start where you left off in case the app is closed or you try to view the app on a different device or platform, such as the web. To make such seamless integration work, we need to ask the server for the data and have all of the data persisted remotely.

In this chapter, we will switch back to working on ...

Get Hands-On Full-Stack Development with Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.