Testing/Displaying Count

This commit is contained in:
Dallon Archibald
2021-01-23 18:50:10 -05:00
parent 4ff0455afd
commit 26c2b2832e
2 changed files with 30 additions and 2 deletions
+18 -2
View File
@@ -24,7 +24,7 @@ class StopwatchViewController: UIViewController {
var minutes = 0
var seconds = 0
var lappedTimes: [String] = ["1", "2", "3"]
var lappedTimes: [String] = []
var timer = Timer()
override func viewDidLoad() {
@@ -32,7 +32,23 @@ class StopwatchViewController: UIViewController {
// Do any additional setup after loading the view.
}
@IBAction func start(_ sender: UIButton) {
timer = Timer.scheduledTimer(timeInterval: 1, target: self, selector: #selector(count), userInfo: nil, repeats: true)
}
@IBAction func stop(_ sender: UIButton) {
}
@IBAction func reset(_ sender: UIButton) {
}
@IBAction func lap(_ sender: UIButton) {
}
@objc fileprivate func count() {
seconds += 1
print(seconds)
}
}
extension StopwatchViewController: UITableViewDelegate, UITableViewDataSource {