Swift API Calls for Beginners (Networking) - Async Await & JSON

preview_player
Показать описание

Learning how to write network calls as a beginner in Swift can be daunting. I remember it taking me a long time to fully grasp them. In this video I break down the basics of how network calls work and introduce you to the concept of JSON (JavaScript Object Notation).

I show you how to download data from the GitHub API with a network call and display a basic user profile page using that data. For this we use Swift Concurrency with Async Await.

This tutorial was created using Xcode 14 and iOS 16.

My iOS Dev Courses:

iOS Developer Interview Questions Playlist:

Twitter:

Book and learning recommendations that help out the channel if you decide to purchase (Affiliate Links):

Paul Hudson's Hacking With Swift:

Donny Wals - Combine:

Mark Moeyken’s SwiftUI Books:

#swift #softwaredeveloper #iosdeveloper

Timestamps:
0:00 - Networking in iOS Apps
0:32 - This is hard!
1:06 - What is JSON?
2:06 - Using CURL to test a response
3:39 - Open API, OAuth, API Keys - Out of Scope
4:14 - My 4 Step Process for API Calls
5:10 - Using JSON to inform your design
5:46 - Create Models from JSON
9:13 - Network Call Code
18:10 - Networking Code Review
20:02 - Using the network call
22:48 - Connecting the UI
Рекомендации по теме
Комментарии
Автор

Coming from web world. Finally found a good creator for swift. Time to binge….

parkerrex
Автор

man you are just the goat of swift tutorials, I've learned a lot from you, thanks a lot!!

TheNicolas
Автор

9:45 Sean! I love that you talk about being confused [as a beginner] by things being all over the place in different directories/files. 

That happens for me too.

This type of "compassion" is rare. So many teachers just assume, and don't have the ability—or don't care to—reach back into the past and remember what it was like to start out.

Keep doing this. It sets you apart as a teacher. 

A professional writer friend of mine—who used to have an excellent podcast—said this all the time: "You're not alone." He peppered it in his writing. And often started articles that way. It was his go-to.

Why is this so important? Because ultimately people feel alone. [Most won't admit it.] 

We want to belong. 

To know *you* struggled at one point just like I am today? That makes me included. Like i'm not just some idiot that will never get this. It's empowering: "I got this."

Thanks again. Love learning from you (and @twostraws).

manwithllama
Автор

I’m moving away from completion-type networks calls and I am happy that this video is out

jaylensmith
Автор

You should keep making videos... it should be a request from whole iOS community! Kudos to you!

GouravSinghalMusiTech
Автор

Thank you SO MUCH Sean this goes straight to the point and very informative and easy to follow the logic behind. Very very well conveyed! ❤

mingy
Автор

I coded along and it worked beautifully! Learned a lot. Wonderful introduction to async and URL session. Thank you!

AngleIron
Автор

Simple, quick and streigth to the point. Love this tutorial!!
Thanks Sean! 🙏🏻

ArthasFede
Автор

Best tutorial ever for Networking and API calls in Swift UI!

bleulejour
Автор

yeah i have watched 20+ videos about this topic and yet this is the only video that worked for me. Thanks bud

iLoveAppl
Автор

Thank you ! I'm learning swift as an experienced Spring/Java developer and your tutorials help me to grab the fundaments of Swift with actual functionality which is interesting to follow. Simply great & please keep up posting

tharindudarshana
Автор

Very good training video and an important training video to watch. I like how you demonstrate network calls and syncing the API data, coding the JSON, and creating a starter page all on one Xcode file. This makes it much easier to follow.

patgoo
Автор

Thanks so much. It is true - for a beginner having all the code in one place makes it easier to understand.

cheeesecake
Автор

Great job. So much easier than the Obj-C.

If you haven’t, since you brought it up, you might do a pros/cons video on multiple files. I’m sure there are going to be many opinions on ‘how big is too big’ for 1 file.

WestCoastAce
Автор

I am mostly a web developer using Javascript, PHP, MySQL and Apache server and I developed my own framework using these tools. I have decided to expand my framework to handshake with Swift and Kotlin ecosystems so I can develop apps that communicate with my other framwork! This video was my starting point. !! Thanks

thanasisathanasi
Автор

Great video. Covered multiple subtle but important topics. Thank you.

samr.
Автор

I've been doing Apps with network requests for a while, but I haven't messed around with using async await yet. This lesson will be really useful for trying to apply it in a new App I'm building. Thank you for a clear explanation as always!

davidcbeaudoin
Автор

sean thank you soooo much, this cleared up a lot for me. i love how you progessivly recap the code it really helps me understand!

ash_
Автор

Thank you! I started out learning iOS until I went to Flutter! I’m looking to learn more Native iOS and you made this easy for me. This is pretty similar to making network calls in Flutter.

KalDillard
Автор

Thank you so much. I didn't know that we can also use async await keywords on Swift and on networking. I was doing my all networking codes with dataTask. It gave me a new perspective. Also It's nice to see Paul here too.