ALAMOFIRE: BUILD WEATHER APP WITH REST API, JSON AND ALAMOFIRE IN iOS WITH SWIFT
FREE DOWNLOAD: https://ductran.co/p/alamofire-weather
Most apps in the world now need to download, post or even delete some data from the Internet.
How do apps like Facebook, Instagram, Yelp work?
They all use REST APIs and JSON.
REST stands for REpresentational State Transfer.
API is Application Programming Interface.
And JSON is JavaScript Object Notation.
In this training, you’ll learn about RESTful API, how to make network calls, how to build network stack using URLSession and URLRequest in iOS, how to parse JSON in iOS.
Parse JSON is the task that every developer needs to know. So does making network calls with REST APIs.
Join me in this training and build the weather app!
FREE DOWNLOAD: https://ductran.co/p/alamofire-weather
*********
ABOUT CODE MASTERY
*********
Code Mastery is hosted by Duc Tran, founder of Developers Academy.
This is his free-style no notes, no teleprompter presentation and live coding broadcast with you guys everyday.
To join Duc’s free courses, register for free at http://ductran.co/
*********
MEET DUC TRAN
*********
Duc Tran is founder of Developers Academy, one of the world’s leading iOS, Android and Web development trainers.
More than 2,000,000 developers have studied his video trainings; 100,000 developers see his posts each month. Each year, Duc has helped 20,000 plus developers graduate from his online courses or video series.
*********
FREE TRAININGS IN IOS DEVELOPMENT
*********
To subscribe and get free tutorials, courses and weekly content, visit me at: http://ductran.co/
Connect with Duc on facebook: http://facebook.com/ductranfan
Tweet him: https://twitter.com/ductrongtran
Get daily inspiration: http://instagram.com/ductran.co/
*********
SOURCE CODE IN THIS COURSE
*********
NetworkProcessor.swift
class NetworkProcessor
{
lazy var configuration: URLSessionConfiguration = URLSessionConfiguration.default
lazy var session: URLSession = URLSession(configuration: self.configuration)
let url: URL
init(url: URL)
{
self.url = url
}
typealias JSONDictionaryHandler = (([String : Any]?) – Void)
func downloadJSONFromURL(_ completion: @escaping JSONDictionaryHandler)
{
let request = URLRequest(url: self.url)
let dataTask = session.dataTask(with: request) { (data, response, error) in
if error == nil {
if let httpResponse = response as? HTTPURLResponse {
switch httpResponse.statusCode {
case 200:
// successful response
if let data = data {
do {
let jsonDictionary = try JSONSerialization.jsonObject(with: data, options: .mutableContainers)
completion(jsonDictionary as? [String : Any])
} catch let error as NSError {
print(“Error processing json data: (error.localizedDescription)”)
}
}
default:
print(“HTTP Reponse Code: (httpResponse.statusCode)”)
}
}
} else {
print(“Error: (error?.localizedDescription)”)
}
}
dataTask.resume()
}
}
Full access to source code: https://ductran.co/p/weather-rest-api
Episode tags: duc tran, ductran.co, developers academy, REST, REST API, REST API in ios tutorial, ios REST API, how to parse json, parse json in ios, parse json, parse json swift, parse json swift tutorial, parse json in Swift, alamofire, alamofire tutorial, uicollectionview, json ios, ios json parsing, ios json, ios json tutorial, json swift tutorial, swift json tutorial, parse json in ios,swiftyjson, nsurlsession, urlsession, firebase, alamofire, alamofire tutorial, alamofire swift tutorial
source
#USA #News #USnews #worldnews #headlinenews #Breakingnews #weathernews #UnitedStates news #CanadianNews #weatherforecast top news #stories,Us news today #hourlyweather forecast
Related News
Tornado Alley – Season 2: Little Hope of Survival – Weather Channel Videos
“Tornado Alley” provides uncharted access to all things tornado – bringing viewers face-to-face with the Read More
Strangest Weather on Earth: Ice Daggers of Doom – Weather Channel Videos
Beware of what’s above you when walking outside this winter. Catch more crazy videos like Read More