Functions
The following functions are available globally.
-
Execute the task closure on specified queue after delayed seconds.
Declaration
Swift
@discardableResult public func delay(_ delayedSeconds: TimeInterval, queue: DispatchQueue = .global(), task: @escaping () -> Void) -> DelayTask
Parameters
delayedSeconds
The delayed seconds.
queue
The dispatch queue to run on.
task
The closure to run.
-
Linearly interpolates between start and end by t. The parameter t is clamped to the range [0, 1]. When t = 0 returns start. When t = 1 return end. When t = 0.5 returns the midpoint of start and end.
Declaration
Swift
public func lerp<T>(start: T, end: T, t: T) -> T where T : BinaryFloatingPoint
Parameters
start
The start value.
end
The end value.
t
The interpolation value between the two floats.
Return Value
The interpolated float result between the two float values.
-
Optional Assignment Operator
If the rhs is
.None
then this operator behaves as a no operation. If the rhs is `.Some(T) then this operator safely unwraps and binds the value so that it can be assigned to lhsDeclaration
Swift
public func =? <T>(lhs: inout T, rhs: T?)
Parameters
lhs
a non-optional variable of a given type T
rhs
an optional value of type T?
-
Optional Assignment Operator
If the rhs is
.None
then this operator behaves as a no operation. If the rhs is `.Some(T) then this operator safely unwraps and binds the value so that it can be assigned to lhsDeclaration
Swift
public func =? <T>(lhs: inout T?, rhs: T?)
Parameters
lhs
a non-optional variable of a given type T
rhs
an optional value of type T?
-
Undocumented
Declaration
Swift
public func ??? <T>(lhs: T?, defaultValue: @autoclosure () -> String) -> String