Agent skill · software engineering · dpearson2699

swiftui-webkit

Embeds and controls web content in SwiftUI with WebKit for SwiftUI, including WebView, WebPage, navigation policies, JavaScript execution, observable page state, link interception, local HTML or data loading, and custom URL schemes. Use when building iOS 26+ article/detail views, help centers, in-app documentation, or other embedded web experiences backed by HTML, CSS, and JavaScript.

Why this skill is useful

Provides specific integration patterns and usage examples for WebKit in SwiftUI that the AI wouldn't reliably generate on its own.

What it needs

Requires xcode installed locally. About 6k tokens when loaded. Last updated 2026-07-31. 973 stars on the source repository.

What this skill does

SwiftUI WebKit Embed and manage web content in SwiftUI using the native WebKit-for-SwiftUI APIs introduced for iOS 26, iPadOS 26, macOS 26, and visionOS 26. Use this skill when the app needs an integrated web surface, app-owned HTML content, JavaScript-backed page interaction, or custom navigation policy control. Contents Choose the Right Web Container Displaying Web Content Loading and Observing with WebPage Navigation Policies JavaScript Integration Local Content and Custom URL Schemes WebView Customization Common Mistakes Review Checklist References Choose the Right Web Container Use the narrowest tool that matches the job. Need Default choice --- --- Embedded app-owned web content in SwiftUI WebView + WebPage iOS/iPadOS modal browsing with Safari behavior SFSafariViewController macOS or visionOS browse-out behavior openURL / default browser OAuth or third-party sign-in ASWebAuthenticationSession Back-deploy below iOS 26 or use missing legacy-only WebKit features WKWebView fallback Prefer WebView and WebPage for modern SwiftUI apps targeting iOS 26+ when the new API surface covers the feature. Apple’s WWDC25 guidance frames existing UIKit/AppKit WebKit wrappers in SwiftUI apps as good candidates to try migrating, not as a blanket mandate to delete every fallback. Do not use embedded web views for OAuth. That stays an ASWebAuthenticationSession flow. Displaying Web Content Use the simple WebView(url:) form when the app only needs to render a URL and SwiftUI state drives navigation. Create a WebPage when the app needs to load requests directly, observe state, call JavaScript, or customize navigation behavior. A WebPage can be associated with only one WebView at a time. Create separate WebPage instances for multiple visible web views. See references/loading-and-observation.md for full examples. Loading and Observing with WebPage WebPage is an @MainActor observable type. Use it when you need page state in SwiftUI. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills dpearson2699/swiftui-webkit

View the source on GitHub

Browse the @skills marketplace