Timers.swift 636 B

123456789101112131415161718192021
  1. // LoopFollow
  2. // Timers.swift
  3. // Created by Jon Fawcett on 2020-09-03.
  4. import Foundation
  5. import UIKit
  6. extension MainViewController {
  7. func startGraphNowTimer(time: TimeInterval = 60) {
  8. graphNowTimer = Timer.scheduledTimer(timeInterval: time,
  9. target: self,
  10. selector: #selector(MainViewController.graphNowTimerDidEnd(_:)),
  11. userInfo: nil,
  12. repeats: true)
  13. }
  14. @objc func graphNowTimerDidEnd(_: Timer) {
  15. createVerticalLines()
  16. }
  17. }