Instance Method


Evaluates the specified policy.


func evaluatePolicy(_ policy: LAPolicy, localizedReason: String, reply: @escaping (Bool, Error?) -> Void)



The policy to evaluate. For possible values, see LAPolicy.


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 canEvaluatePolicy(_:error:) in this block, because doing so could lead to deadlock.


true if policy evaluation succeeded, otherwise false.


nil if policy evaluation succeeded, an error object that should be presented to the user otherwise. See LAError.Code for 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.

See Also

Evaluating Authentication Policies

func canEvaluatePolicy(LAPolicy, error: NSErrorPointer)

Preflights an authentication policy to see if it is possible for authentication to succeed.

var evaluatedPolicyDomainState: Data?

The current state of the evaluated policy domain.