Evaluates the specified policy.
- iOS 8.0+
- macOS 10.10+
The policy to evaluate. For possible values, see
The app-provided reason for requesting authentication, which displays in the authentication dialog presented to the user. In macOS this appears in the title, and in iOS this appears in the subtitle. This string should be provided in the user’s current language and should be short and clear. It should not contain the app name, because that appears elsewhere in the authentication dialog.
A block that is executed when policy evaluation finishes. This block is evaluated on a private queue internal to the framework in an unspecified threading context. You must not call
canin this block, because doing so could lead to deadlock.
Evaluate Policy(_: error:)
trueif policy evaluation succeeded, otherwise
nilif policy evaluation succeeded, an error object that should be presented to the user otherwise. See
LAErrorfor possible error codes
This method asynchronously evaluates an authentication policy. The
reply block is used to deliver the results of the evaluation. Evaluating a policy may involve prompting the user for various kinds of interaction or authentication. The actual behavior is dependent on the evaluated policy and device type. It can also be affected by installed configuration profiles.
You should not assume that a previous successful evaluation of a policy necessarily leads to a subsequent successful evaluation. Policy evaluation can fail for various reasons, including cancelation by the user or the system.