Calls the given closure with a mutable pointer to the given argument.
- Xcode 8.0+
- Swift Standard Library
An instance to temporarily use via pointer. Note that the
inoutexclusivity rules mean that, like any other
valuecannot be directly accessed by other code for the duration of
body. Access must only occur through the pointer argument to
A closure that takes a mutable pointer to
valueas its sole argument. If the closure has a return value, that value is also used as the return value of the
withfunction. The pointer argument is valid only for the duration of the function’s execution.
Unsafe Mutable Pointer(to: _:)
The return value, if any, of the
with function is useful for calling Objective-C APIs that take in/out parameters (and default-constructible out parameters) by pointer.
The pointer argument to
body is valid only during the execution of
with. Do not store or return the pointer for later use.