[U] Update function calls

This commit is contained in:
Hykilpikonna
2021-01-17 13:14:19 -05:00
parent 02d8b40831
commit c3fc3e827f
2 changed files with 2 additions and 5 deletions
+2 -2
View File
@@ -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)
-3
View File
@@ -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>
{