I am lost on how to save my JSON as a Dictionary not as (Array of Dictionary)
I got this working perfectly as a Array of Dictionaries with this URL ( http://api.androidhive.info/contacts/ )
How can I capture as a pure dictionary ??
override func viewDidLoad() {
super.viewDidLoad()
Alamofire.request(.GET, "http://logger.lumberjacksystem.com/index.php/api/list_stories/74/74/").responseJSON { (responseData) -> Void in
let swiftyJsonVar = JSON(responseData.result.value!)
if let resData = swiftyJsonVar["contacts"].arrayObject {
self.arrayOfDictionary = resData as! [[String:AnyObject]]
}
if self.arrayOfDictionary.count > 0 {
self.tblJSON.reloadData()
}
}
}
Which part of the data structure are you trying to save?
Your swiftyJsonVar is a JSON dictionary with one entry, which is an array of dictionaries. Are you trying to capture the root dictionary, or one of those in the array?