AssertUtilities
public enum AssertUtilities
A utility type that replaces the internal implementation of assertion functions.
-
A closure that handles an assertion.
Declaration
Swift
public typealias AssertClosure = (Bool, Error, StaticString, UInt) -> () -
A closure that handles an assertion failure.
Declaration
Swift
public typealias AssertionFailureClosure = (Error, StaticString, UInt) -> () -
Replaces the internal implementation of
assert(_:error:file:line:)with the given closure. Returns aRestorationHandlerto execute that restores the original implentation.Declaration
Swift
static public func replaceAssert( with closure: @escaping AssertClosure ) -> RestorationHandlerParameters
closureThe closure to execute when
assert(_:error:file:line:)is called. -
Replaces the internal implementation of
assertionFailure(error:file:line:)with the given closure. Returns aRestorationHandlerto execute that restores the original implentation.Declaration
Swift
static public func replaceAssertionFailure( with closure: @escaping AssertionFailureClosure ) -> RestorationHandlerParameters
closureThe closure to execute when
assertionFailure(error:file:line:)is called.
View on GitHub
AssertUtilities Enumeration Reference