swiftui-webkit

Embed and manage web content in SwiftUI with WebKit-for-SwiftUI.

Updated May 10, 2026
One-click install
npx skills add https://github.com/FelixRauch/medat-figuren --skill swiftui-webkit-felixrauch
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: swiftui-webkit
Source: https://github.com/FelixRauch/medat-figuren/tree/main/.agents/skills/swiftui-webkit
Command: npx skills add https://github.com/FelixRauch/medat-figuren --skill swiftui-webkit-felixrauch

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

SwiftUI apps need to show and interact with web content while still maintaining native responsiveness, state updates, and controlled navigation instead of relying on UIKit wrappers or unmanaged browsing behavior.

Core Features & Use Cases

  • Native embedded browsing for iOS 26+ SwiftUI: Use WebView and WebPage to render web content in SwiftUI with observable page state such as loading status, title, URL, and progress.
  • Navigation control and link routing: Use WebPage.NavigationDeciding to allow, cancel, or reroute navigations—keeping app-owned URLs embedded while handing external destinations to the system via openURL.
  • JavaScript integration for interactive pages: Execute JavaScript via callJavaScript and pass arguments to extract data from the loaded document.
  • Local/offline HTML with custom URL schemes: Serve bundled HTML/CSS/JS through URLSchemeHandler for docs-like experiences and offline help content.

Use case example: An app shows an in-app help article hosted as bundled HTML, reads metadata from the page after navigation finishes, and intercepts navigation to external links so they open outside the embedded surface.

Quick Start

Tell the assistant: "Design a SwiftUI iOS 26+ screen using WebView and WebPage that loads an app-owned docs page, shows a loading progress overlay, intercepts external links to open them with openURL, and calls JavaScript after the navigation finishes to extract article headings."

Frequently Asked Questions about swiftui-webkit

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

FAQPage Schema
How do I embed and control web content in SwiftUI without using UIKit wrappers?

To embed web content in SwiftUI natively, use WebView and WebPage primitives to render pages while maintaining observable state for loading status, title, URL, and progress without relying on UIKit wrappers.

How do I intercept and route navigation links in a SwiftUI WebPage?

To intercept navigation in a SwiftUI WebPage, implement WebPage.NavigationDeciding to allow, cancel, or reroute navigations, keeping app-owned URLs embedded while passing external destinations to the system via openURL.

Can I execute JavaScript and extract data from a loaded webpage in SwiftUI?

Yes, you can execute JavaScript in SwiftUI embedded web content by using the callJavaScript method to pass arguments and cast return values, extracting data like article headings after the page navigation finishes.

What is the best way to load local offline HTML documentation in a SwiftUI app?

The best way to load offline HTML in SwiftUI is by serving bundled HTML, CSS, and JS files through a custom URLSchemeHandler, creating a docs-like experience without requiring a network connection.

Does embedded WebKit browsing in SwiftUI support iOS 26+ state observation?

Yes, embedded WebKit browsing in SwiftUI supports iOS 26+ state observation, allowing you to monitor page loading lifecycle, track progress, and trigger routing decisions based on observable state updates.

Why do I need a NavigationDeciding policy for embedded SwiftUI browsing?

You need a NavigationDeciding policy for embedded SwiftUI browsing to distinguish between app-owned URLs that should remain in the WebView and external links that must be routed out to the system browser.