As the description in the demo, if there is no credentials, will receive the same error code (ASAuthorizationErrorCanceled) as if the user canceled. In this case, Is there a way to distinguish whether the error is canceled by the user or no credentials?
if authorizationError.code == .canceled {
// Either the system doesn't find any credentials and the request ends silently, or the user cancels the request.
// This is a good time to show a traditional login form, or ask the user to create an account.
} else {
// Another ASAuthorization error.
// Note: The userInfo dictionary contains useful information.
logger.error("Error: \((error as NSError).userInfo)")
}
}