[U] Update function calls
This commit is contained in:
@@ -23,7 +23,7 @@ extension AlarmViewController: UITableViewDelegate, UITableViewDataSource
|
||||
func numberOfSections(in: UITableView) -> Int { return 1 }
|
||||
|
||||
/// How many rows are there
|
||||
func tableView(_ v: UITableView, numberOfRowsInSection s: Int) -> Int { return getLocalAlarms().count }
|
||||
func tableView(_ v: UITableView, numberOfRowsInSection s: Int) -> Int { return Alarms.fromLocal().list.count }
|
||||
|
||||
/// Configure each cell
|
||||
func tableView(_ v: UITableView, cellForRowAt i: IndexPath) -> UITableViewCell
|
||||
@@ -31,7 +31,7 @@ extension AlarmViewController: UITableViewDelegate, UITableViewDataSource
|
||||
// Get the cell and item at index i
|
||||
let rawCell = v.dequeueReusableCell(withIdentifier: "alarm", for: i)
|
||||
guard let cell = rawCell as? AlarmTableCell else { return rawCell }
|
||||
let item = getLocalAlarms()[i.row]
|
||||
let item = Alarms.fromLocal().list[i.row]
|
||||
|
||||
// Set the content of the cell to the content of the item.
|
||||
cell.setData(item)
|
||||
|
||||
@@ -30,9 +30,6 @@ class JSON
|
||||
/// Local storage
|
||||
let localStorage = UserDefaults(suiteName: "group.org.hydev.alarm.clock")!
|
||||
|
||||
/// Get alarms from local storage
|
||||
func getLocalAlarms() -> [Alarm] { return JSON.parse([Alarm].self, localStorage.string(forKey: "alarms")!)! }
|
||||
|
||||
/// API class
|
||||
struct API<T>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user