Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) {
- do {
- //JSON資料處理
- let dataDic = try JSONSerialization.jsonObject(with: Data(contentsOf: location), options: JSONSerialization.ReadingOptions.mutableContainers) as! [String:[String:AnyObject]]
- //依據先前觀察的結構,取得result對應中的results所對應的陣列
- dataArray = dataDic["StationName"]!["Zh_tw"] as! [AnyObject]
- //重新整理Table View
- self.tableView.reloadData()
- } catch {
- print("Error!")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement