WKUIDelegate
The methods for presenting native user interface elements on behalf of a webpage.
Declaration
@MainActor protocol WKUIDelegate : NSObjectProtocolOverview
Web view user interface delegates implement this protocol to control the opening of new windows, augment the behavior of default menu items displayed when the user clicks elements, and perform other user interface-related tasks. These methods can be invoked as a result of handling JavaScript or other plug-in content. The default web view implementation assumes one window per web view, so nonconventional user interfaces might implement a user interface delegate.
Topics
Creating and closing the web view
Displaying UI panels
webView(_:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:)webView(_:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:)webView(_:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler:)webView(_:showLockdownModeFirstUseMessage:completionHandler:)WKDialogResult
Displaying an upload panel
Displaying a contextual menu
Adding context menus in your appwebView(_:contextMenuConfigurationForElement:completionHandler:)webView(_:contextMenuForElement:willCommitWithAnimator:)webView(_:contextMenuWillPresentForElement:)webView(_:contextMenuDidEndForElement:)UIContextMenuConfiguration
Displaying an edit menu
Requesting permissions
webView(_:requestDeviceOrientationAndMotionPermissionFor:initiatedByFrame:decisionHandler:)webView(_:requestMediaCapturePermissionFor:initiatedByFrame:type:decisionHandler:)WKPermissionDecisionWKMediaCaptureType