Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "result": [
- {
- "values": [
- {
- "value":"null",
- "key":"symbol_2"
- },
- {
- "value":"null",
- "key":"symbol_1"},
- {
- "value":"016",
- "key":"company"
- },
- {
- "value":"QUW12DO",
- "key":"direction"
- },
- {
- "value":"TD-4WYS",
- "key":"road"
- },
- {
- "value":"04:35:00",
- "key":"time"
- }]},
- URLSession.shared.dataTask(with: (url as URL?)!, completionHandler: {(data, response, error) -> Void in
- if let jsonObj = try? JSONSerialization.jsonObject(with: data!, options: .allowFragments) as? NSDictionary {
- print(jsonObj!.value(forKey: "result")!)
- if let stopsArray = jsonObj!.value(forKey: "result") as? NSArray {
- for stop in stopsArray{
- if let stopDict = stop as? NSDictionary {
- let hours = stopDict.value(forKey: "time")
- let myModel = Hours(hours: hours as? String)
- self.list.append(myModel)
- print("LIST: (self.list)")
- DispatchQueue.main.async {
- self.actInd.stopAnimating()
- self.actInd.isHidden = true
- self.containerLittle.isHidden = true
- self.loadingView.isHidden = true
- }
- }
- }
- }
- }
- }).resume()
Add Comment
Please, Sign In to add comment