DispatchSource
public extension DispatchSource
-
Convenience function to encapsulate creation of a one-off DispatchSourceTimer for different versions of Swift
Declaration
Swift
static func makeOneOffDispatchSourceTimer( interval: DispatchTimeInterval, queue: DispatchQueue, block: @escaping () -> Void ) -> DispatchSourceTimerParameters
intervalThe future DispatchInterval at which to fire the timer
queueThe queue on which the timer should perform its block
blockThe block to invoke when the timer is fired
Return Value
The unstarted timer
-
Convenience function to encapsulate creation of a one-off DispatchSourceTimer for different versions of Swift
Declaration
Swift
static func makeOneOffDispatchSourceTimer( deadline: DispatchTime, queue: DispatchQueue, block: @escaping () -> Void ) -> DispatchSourceTimerParameters
deadlineThe time to fire the timer
queueThe queue on which the timer should perform its block
blockThe block to invoke when the timer is fired
View on GitHub