SwiftUI Tutorial: How to make a API call, fetch JSON, and structure you networking layer with MVVM

Описание к видео SwiftUI Tutorial: How to make a API call, fetch JSON, and structure you networking layer with MVVM

In this tutorial, we are going to fetch JSON data from an API and show it in a list view in SwiftUI. I will discuss how I structure my code base with MVVM (Model - View Model - View). Also I am including an extra layer for the networking logic because it helps make my code more reusable and write unit tests. You will also learn about error handling with URLSession and how to show error information to the user.

😻 The example API is the cat API.
https://thecatapi.com/

Overview
00:00 Introduction
02:52 project organisation with MVVM
15:05 error handling, custom error type
19:03 Separate networking layer and error handling
28:44 loading view
29:48 error view
33:08 breed list views with AsyncImage
41:18 searchable view modifier to search by breed name
43:11 cat breed detail view
47:11 unit tests, mock service and dependency injection
54:29 Wrap up

🤩 Learn more
Part 1: working with the Web, HTTP, JSON, and REST APIs    • iOS Swift Tutorial: Working with the ...  
Part 2: Parsing JSON    • iOS Swift Tutorial - Working with the...  

If you liked what you learned and you want to see more, check out one of my courses!
👨‍💻 my SwiftUI course https://school.swiftyplace.com/course...
👨‍💻 my Core Data and SwiftUI course https://school.swiftyplace.com/course...
👩🏻‍💻 Combine course
https://school.swiftyplace.com/course...


⬇️ Project files: https://github.com/gahntpo/CatAPISwiftUI

#SwiftUI #networking #JSONParsing #API

Комментарии

Информация по комментариям в разработке