preconditionIsolated(_:file:line:)
Stops program execution if the current task is not executing on this serial executor.
Declaration
@backDeployed(before: macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0)
func preconditionIsolated(_ message: @autoclosure () -> String = String(), file: StaticString = #fileID, line: UInt = #line)Parameters
- message:
The message to print if the assertion fails.
- file:
The file name to print if the assertion fails. The default value is the file where this method was called.
- line:
The line number to print if the assertion fails The default value is the line where this method was called.
Discussion
This function’s effect varies depending on the build flag used:
In playgrounds and
-Ononebuilds (the default for Xcode’s Debug configuration), stops program execution in a debuggable state after printingmessage.In
-Obuilds (the default for Xcode’s Release configuration), stops program execution.