SwiftUI: List API Call

In this post we are going to take a look at how we can get JSON data from an API and show it in a list view in SwiftUI.

Let’s jump right in and get started by creating a new SwiftUI project.

Our expected output:

Step1: Create a UserDetails model class for fetching the user’s details.

Step2: Will create a service UserDetailsAPI class to call the API.

Step3: Create a UserListView swiftUI view to display the response.

Thanks for reading this blog….

--

--

iOS Developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store