assertIsolated(_:file:line:)
Stops program execution if the current task is not executing on this serial executor.
- iOS
- 13.0+
- macOS
- 10.15+
- tvOS
- 13.0+
- watchOS
- 6.0+
@backDeployed(before: macOS 14.0, iOS 17.0, watchOS 10.0, tvOS 17.0)
func assertIsolated(_ message: @autoclosure () -> String = String(), file: StaticString = #fileID, line: UInt = #line)
Parameters
This function’s effect varies depending on the build flag used:
In playgrounds and
-Onone
builds (the default for Xcode’s Debug configuration), stops program execution in a debuggable state after printingmessage
.In
-O
builds (the default for Xcode’s Release configuration), the isolation check is not performed and there are no effects.