Edited table view display

This commit is contained in:
Dallon Archibald
2021-01-23 18:44:16 -05:00
parent 34cc04cd63
commit 4ff0455afd
+3 -2
View File
@@ -24,6 +24,7 @@ class StopwatchViewController: UIViewController {
var minutes = 0 var minutes = 0
var seconds = 0 var seconds = 0
var lappedTimes: [String] = ["1", "2", "3"]
var timer = Timer() var timer = Timer()
override func viewDidLoad() { override func viewDidLoad() {
@@ -37,12 +38,12 @@ class StopwatchViewController: UIViewController {
extension StopwatchViewController: UITableViewDelegate, UITableViewDataSource { extension StopwatchViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 100 return lappedTimes.count
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "lapCell", for: indexPath) let cell = tableView.dequeueReusableCell(withIdentifier: "lapCell", for: indexPath)
cell.textLabel?.text = "I am a lap cell \(indexPath.row + 1)" cell.textLabel?.text = lappedTimes[indexPath.row]
return cell return cell
} }
} }