SwiftUI - Fetching json data from an API (GET & POST HTTP requests) using URLSession

preview_player
Показать описание
In this tutorial, I'm going to show how to fetch JSON data from an API using URLSession(GET & POST requests) with the MVVM (Model View ViewModel) Design Pattern in SwiftUI

And you can learn about how to use
- ObservableObject
- @Published
- @ObservedObject

for MVVM to fetch JSON data in SwiftUI, SwiftUI 2.0

Source code:

Example JSON URL for testing
GET HTTP Request

POST HTTP Request

MVVM with ObservableObject @Published @ObservedObject to fetch JSON

Create a Login and Register page with Neuromorphic Design
Рекомендации по теме
Комментарии
Автор

Perfect video! Thank you! Exactly what i was looking for without having to learn the presenter's entire project

billbarthel
Автор

Thanks for sharing... is important that every dev know how to make GET and POST request with API

Decatilinae
Автор

Can you show in the same project how to use progress bar to show the user that is loading and an alert to notify that the data was posted correctly

Decatilinae
Автор

Can you also show the database post operations for mysql + php?

emrecan
Автор

Source code isn't always accessible bro

elliotknight