Functions
The following functions are available globally.
-
Asynchronously executes the passed-in function on a concurrent GCD queue.
Declaration
Swift
public func async(_ fn: @escaping () -> Void)Parameters
fnThe function to execute asynchronously.
-
After a specified delay, asynchronously executes the passed-in function on a concurrent GCD queue.
Declaration
Swift
public func async(delay: TimeInterval, _ fn: @escaping () -> Void)Parameters
delayThe number of seconds to wait before executing
fnasynchronously. This is not real-time scheduling, so the function is guaranteed to execute after this amount of time, not after this amount of time.fnThe function to execute asynchronously.
-
Asynchronously executes the passed-in function on a concurrent GCD queue, treating it as a barrier. Functions submitted to the queue prior to the barrier are guaranteed to execute before the barrier, while functions submitted after the barrier are guaranteed to execute after the passed-in function has executed.
Declaration
Swift
public func asyncBarrier(_ fn: @escaping () -> Void)Parameters
fnThe function to execute asynchronously.
-
Asynchronously executes the specified function on the main thread.
Declaration
Swift
public func mainThread(_ fn: @escaping () -> Void)Parameters
fnThe function to execute on the main thread.
-
Asynchronously executes the specified function on the main thread.
Declaration
Swift
public func mainThread(delay: TimeInterval, _ fn: @escaping () -> Void)Parameters
delayThe number of seconds to wait before executing
fnasynchronously. This is not real-time scheduling, so the function is guaranteed to execute after this amount of time, not after this amount of time.fnThe function to execute on the main thread.
View on GitHub
Functions Reference