Timers.swift 595 B

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