Commit 228357b8 authored by Eyad Hasan's avatar Eyad Hasan
Browse files

New Data Model

The code is almost there to download and store the data, I have to write the realm objects so I can store everything correctly, but I can finally say, almost there
parent b5d4ed23
......@@ -27,9 +27,13 @@ class SRCTNetworkController: NSObject {
if (statusCode == 200) {
if let dataN = data {
//var schedules = Array
//Finish this, and fix the function
let json = try? JSONSerialization.jsonObject(with: dataN, options: [])
if let schedule = json as? [String: Any]{
if let Array: currentSchedule = schedule["main_schedule"] as? Array {
if let currentSchedule = schedule["main_schedule"] as? Array{
schedules.append(currentSchedule)
}
......@@ -43,10 +47,12 @@ class SRCTNetworkController: NSObject {
}
}
print(schedules)
task.resume()
}
print(Facility.MainSchedule.self)
task.resume()
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment