Using Swift 5.5 Async Await to Fetch REST API

Callback vs Async Await

As an iOS developer, most probably you already have lot of experiences to fetch REST API from multiple endpoints. In some instances, the call to the API endpoints need to be in sequential order as they need the response of previous API call to be passed in HTTP Request.

Let me give you an illustation for such scenario with these given steps:

--

--

--

Mobile Developer and Lifelong Learner. Currently building super app @ Go-Jek. Xcoding with Alfian at https://alfianlosari.com

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Coordinators, the back button and how to solve it

Building my first iOS Apps

SpriteKit + SwiftUI

Shimmer effect with SwiftUI

Text Recognition and Translation on iOS Using ML Kit and Google Translate

Left Rotation HackerRank Swift Solution

Pass data using NSNotification in Swift

Releasing AppInfoFetcher

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
Alfian Losari

Alfian Losari

Mobile Developer and Lifelong Learner. Currently building super app @ Go-Jek. Xcoding with Alfian at https://alfianlosari.com

More from Medium

Share authentication state across your apps, App Clips and Widgets (iOS)

CI/CD Using Fastlane & Jenkins (iOS)

Dependency Injection Patterns

GCD Basics (Serial and Concurrent Queues, Sync vs Async)