swiftui-webkit

Embed and control web content in SwiftUI with WebKit APIs.

Updated May 6, 2026
One-click install
npx skills add https://github.com/Roy-wonji/claude-config --skill swiftui-webkit-roy-wonji
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-webkit
Source: https://github.com/Roy-wonji/claude-config/tree/main/skills/swift-ios-skills/skills/swiftui-webkit
Command: npx skills add https://github.com/Roy-wonji/claude-config --skill swiftui-webkit-roy-wonji

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It solves the problem of embedding and controlling web content inside a SwiftUI app without falling back to generic browser-like wrappers.

Core Features & Use Cases

  • SwiftUI-native Web embedding (iOS 26+): Use WebView for simple URL rendering and WebPage when you need observable page state, navigation control, and tighter integration.
  • Navigation policy control: Allow, cancel, or reroute navigations via WebPage.NavigationDeciding, including opening external domains outside the embedded surface.
  • JavaScript integration and app-owned content: Execute JavaScript with callJavaScript, and serve bundled HTML/CSS/JS via WebPage.Configuration + URLSchemeHandler for offline or custom-scheme docs.
  • Use Case: Build an iOS article/help-center experience where HTML/JS drives interactions, and navigation rules ensure links behave correctly (internal stays embedded, external opens externally).

Quick Start

Use the swiftui-webkit skill to embed your in-app article by rendering a SwiftUI WebView(url:) for simple URLs, and switch to WebPage when you need page state, JavaScript calls, or custom navigation policy.

Frequently Asked Questions about swiftui-webkit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I embed a WebKit web page in SwiftUI?

To embed web content in SwiftUI, use the native WebView component for simple URL rendering. For tighter integration with page state and navigation policy, switch to WebPage for iOS 26+.

What is the difference between WebView and WebPage in SwiftUI?

WebView provides simple URL rendering for SwiftUI, while WebPage offers observable page state, navigation control via WebPage.NavigationDeciding, and JavaScript execution for tighter app integration.

How do I control navigation policy and handle custom URL schemes in a SwiftUI WebView?

Implement WebPage.NavigationDeciding to allow, cancel, or reroute navigations. Serve bundled HTML/CSS/JS via WebPage.Configuration and URLSchemeHandler to handle custom URL schemes.

Can I execute JavaScript from within a SwiftUI WebKit view?

Yes, you can execute JavaScript using the callJavaScript method on a WebPage instance. This allows your app-owned web content to drive interactions while respecting MainActor isolation.

Do I need iOS 26+ to use native WebKit APIs in SwiftUI?

Yes, using native SwiftUI WebKit APIs like WebView and WebPage requires iOS 26+ integration. This ensures proper support for observable page state and safe navigation handling.

How do I load local HTML files into a SwiftUI WebKit component?

Load local HTML files by serving bundled content through WebPage.Configuration combined with a custom URLSchemeHandler. This enables offline or custom-scheme documentation rendering.