Checks a dispatch condition necessary for further execution.
- iOS 10.0+
- macOS 10.12+
- Mac Catalyst 13.0+Beta
- tvOS 10.0+
- watchOS 3.0+
- Xcode 8.0+
A dispatch predicate for the current context to check.
Use this function to detect conditions about the current execution context that must prevent the program from proceeding even in shipping code.
In playgrounds and
-Ononebuilds (the default for Xcode’s Debug configuration): if
false, stop program execution in a debuggable state.
-Obuilds (the default for Xcode’s Release configuration): if
false, stop program execution.
conditionis not evaluated, but the optimizer may assume that it would evaluate to
true. Failure to satisfy that assumption in
-Ouncheckedbuilds is a serious programming error.