diff --git a/ProjectClock/ViewController.swift b/ProjectClock/ViewController.swift index 8967045..1846698 100644 --- a/ProjectClock/ViewController.swift +++ b/ProjectClock/ViewController.swift @@ -9,11 +9,46 @@ import UIKit class ViewController: UIViewController { + @IBOutlet var table: UITableView! + + var models = [MyAlarm]() + override func viewDidLoad() { super.viewDidLoad() - // Do any additional setup after loading the view. + table.delegate = self + table.dataSource = self } +} +extension ViewController: UITableViewDelegate { + + func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { + tableView.deselectRow(at: indexPath, animated: true) + } } +extension ViewController: UITableViewDataSource { + + func numberOfSections(in tableView: UITableView) -> Int { + return 1 + } + + func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { + return models.count + } + + func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { + let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) + cell.textLabel?.text = models[indexPath.row].title + + return cell + } +} + +struct MyAlarm { + let title: String + let date: Date + let identifier: String +} +