8f8f8b2755
macOS menu bar app providing NHL game situational awareness with league-wide scoreboard, dynamic polling, notifications with team logos, and configurable display options.
20 lines
438 B
Swift
20 lines
438 B
Swift
//
|
|
// Timer+startTimer.swift
|
|
// IceGlass
|
|
//
|
|
// Copyright 2026 Rouslan Zenetl. All Rights Reserved.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
extension Timer {
|
|
static func startTimer(timer: Timer?, interval: TimeInterval, action: @escaping @Sendable (Timer) -> Void) -> Timer {
|
|
timer?.invalidate()
|
|
return Timer.scheduledTimer(
|
|
withTimeInterval: interval,
|
|
repeats: true,
|
|
block: action
|
|
)
|
|
}
|
|
}
|