How to make REST API calls & parse JSON with Swift 2.0

preview_player
Показать описание
** NOTE: Code has changed dramatically from Swift 2.0 to 3.1. The video no longer matches the example code in GitHub, but the concepts are similar. **

Pulling a random stat out of thin air, I'd say 90% of web APIs are REST APIs. Don't quote me on the percent, like I said, I made it up. The point is, there's alot of data behind REST APIs and we need to know how to connect our iOS apps to get that data. In this tutorial, we're going to write Swift code to perform a GET and a POST request.





Concepts: iOS, swift, REST, JSON, web services, iphone, ipad

Social Links: Don't hesitate to contact me if you have any further questions.

Related Videos:

Media credits:
All images are owned by DJ Spiess unless listed below:

No copyright infringement intended.

Music:
Рекомендации по теме
Комментарии
Автор

Really good man. Explained everything in broad strokes while other youtubers use 20 minutes :D Subscribed!

doktoren
Автор

You sir have earned yourself a sub! I'm new to Swift, and by new I mean about 3 weeks new. I've been doing PHP development for years, and have been killing myself to make sense of accessing a REST API I've written. Your tutorial honestly just explained in 5 minutes what I've been trying to research and figure out for 72 hours. Great job!

seansaulnier
Автор

High production quality and good explenation not what i was looking for (how to recieve json data in a controller)
Yet ittle be useful when im going to try and send it
You EARNED this sub keep up the good work

floryzzz
Автор

Great video explaining REST api calls! I can't wait to test this code with one of my apps. Thank you!

SergioBarreracoding
Автор

Really nice tutorial! I prefer smaller steps in tutorials but this worked just fine :D There is not a lot of swift 2.0 material on the web at the moment so 2 thumbs up for that! :)

Gummi
Автор

Hello all, it's always good to understand the core syntax and concepts before using libraries like Alamofire. I used libraries and encounter lots of issues when upgrading to Swift 2.3, 3. So now I'm using core codes like in this video. THanks!

stackflow
Автор

It works like a charm! It helps me a lot. Thank you!

xiaohu
Автор

Great video! If the session is happening on another thread, why do I see a lot of other people using GCD? They usually do dispatch_async(queue, 0) { // some code }.

Why are they doing that if it's already on a secondary thread? Thank you!

mihadalzayat
Автор

great video!, specific and complete, thanks a lot!

Tavo-Entertainment
Автор

Thank you for the explaination. Now I see what i have to do to make my MAMP server work and how to structure future php pages.

christophernoyd-stephens
Автор

Thanks for your wonderful explanation, I have a question how can we make a custom class for http communication using swift 2, And use methods of this custom class as and when required in an app by passing arguments to the methods.

anandyadav
Автор

Great tutorial!
Will there be a version for Swift 3 as well?

mortenbangolin
Автор

thanks for the video. Can you guide in detail how to use SQlite with swift ? thanks

MegaUmairafzal
Автор

Thank you for this I did not knew a thing about REST now I can get data. I modified it to work with SwiftJSON :-)

MegaUmairafzal
Автор

Could you possible do a tutorial on how to send and receive information from swift to mysql?

BryanPosso
Автор

Thank you for the tutorial, how can I use it for an Amazon Api IOS app?

Bookupcycle
Автор

Solid tutorial - POST worked first try. Goodbye Alamofire

JustaLune
Автор

can you plz do a vid about http-header-requests for secure API-authentication??

---wfdw
Автор

the idea of learning native languages like swift scares the shit out of me when I see the likes of codes at 2:10 and compare it with react native rest api fetch, :-)

TheFhdude
Автор

I had a question, would your tutorial to post also work with UIImage and text from textfields to a mysql database if I made some tweaks to it?

phillvaloyi