Structures
The following structures are available globally.
-
Additional struct with utility methods to work with coroutines.
Important
Allawait()
methods must be called inside a coroutine.To check if inside a coroutine, use
See moreCoroutine.isInsideCoroutine
. If you callawait()
outside the coroutine, the precondition inside these methods will fail, and you'ill get an error. In -Ounchecked builds, where preconditions are not evaluated to avoid any crashes, a thread-blocking mechanism is used for waiting the result.Declaration
Swift
public struct Coroutine