An iOS Swift Weather App Tutorial
Why Stack Overflow recommends it
Stack Overflow users link it as a worked example of fetching and parsing web JSON in Swift, and askers cite it as the source of the weather-app code they are trying to adapt.
Recommended by 1 people across 1 different months, 2015 to 2016.
What it is
An 18-minute iOS tutorial from 2015 by Evan Z that builds a simple Swift weather app. It covers what a Storyboard is, making HTTP requests with NSURLSession, and parsing a JSON response from a weather API.
What people said
Recommends Gabo Cuadros Cardenas · 2015-08 · Stack Overflow · on “swiftyJSON parsing json from NSURL”
swiftyJSON don´t works with URL´s , swiftJSON works perfectly with local data this is a tutorial that you can see to understand more the swiftJSON [LINK] to parse the JSON from the web you need to do that... [this video]
Cites simpleguy · 2016-03 · Stack Overflow · on “Swift - How to get OpenWeatherMap JSON Data?”
The following app should get the user's current location and then display the Name and Temperature of that location using OpenWeatherMap. import UIKit import CoreLocation class ViewController: UIViewController, CLLocationManagerDelegate { @IBOutlet weak var location: UILabel! @IBOutlet weak var temperature: UILabel! var locationManager: CLLocationManager = CLLocationManager() var startLocation: CLLocation! func extractData(weatherData: NSData) { let json = try? NSJSONSerialization.JSONObjectWithData(weatherData, options: []) as! NSDictionary if json != nil { if let name = json!["name"] as? String { location.text = name } if let main = json!["main"] as? NSDictionary { if let temp = main["temp
Cites Justin Hu · 2016-07 · Stack Overflow · on “SWIFT: Parsing a JSON Object”
first post here! I've been working on my own weather application (I'm a high school student who's self-learning Swift, but already have experience in Java). I'm learning how to use API's to gather information to use in my application and I've been using this video: [this video] At around the 11:38 mark, a JSON object is created: var jsonError: NSError let json = NSJSONSerialization.JSONObjectWithData(weatherData, options: nil, error: &jsonError) as NSDictionary if let name = json["name"] as? String { cityNameLabel.text = name } if let main = json["main"] as? NSDictionary { if let temp = main["temp"] as? Double { cityTemperatureLabel.text = String(format: "%.1f", arguments: temp) } Basically I wan