setPasskeyAuthenticationAnchor
Sets the presentation anchor for passkey authentication dialogs. This method is required for configuring where the passkey UI components will be displayed in your application.
Function Signature
Parameters
anchor
: The window anchor where passkey authentication UI will be presented. This is typically the main window of your application and should be of typeASPresentationAnchor
(which UIWindow conforms to).
Platform Availability
Requires iOS 16.0 or later
Part of the native passkey implementation in iOS
Notes
Must be called before using passkey backup or recovery methods
Should be used in conjunction with
setPasskeyConfiguration
for complete setupThe anchor is used to present the system's native passkey authentication dialog
Example Usage
Implementation Guide
Ensure you're running on iOS 16 or later
Call
setPasskeyConfiguration
first to set up basic passkey settingsObtain a reference to your app's main window or appropriate presentation context
Call this method with the window reference
Now you can use passkey-based authentication features
UI Considerations
The passkey dialog will be presented as a system modal over your application
The presentation anchor should be stable and available throughout the authentication process
For best user experience, call this method when your view hierarchy is fully established
Related Documentation
For more information about passkey, see:
Last updated
Was this helpful?