Timers.swift 705 B

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