# swiftui-webkit

Guides coding agents on native SwiftUI WebKit APIs for iOS 26+. Covers WebView, WebPage observation, custom navigation policies, and JavaScript calls.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 3200 installs · ★ 1237
- Author: dpearson2699
- License: LicenseRef-Unknown · policy=link-only · description only; the file stays with the author
- Source: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/swiftui-webkit/SKILL.md
- Updated: 2026-07-31
- HTML: https://affpapa.org/en/nevibecode/skills/swiftui-webkit

## What it does

This skill outlines native SwiftUI WebKit integrations introduced in iOS 26, iPadOS 26, and macOS 26. It replaces legacy UIKit bridges with native `WebView` views and the `@Observable` `WebPage` class. Assistants rely on it when writing embedded docs, local HTML viewers, or in-app articles.

The guidance covers request streams, observable properties like `isLoading` and `title`, and executing scripts through `callJavaScript(_:arguments:in:contentWorld:)`. Parameters pass via structured argument dictionaries instead of string concatenation.

It is explicitly unsuitable for OAuth login flows, which still mandate `ASWebAuthenticationSession`. Each visible `WebView` also requires its own dedicated `WebPage` instance.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-webkit -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/swiftui-webkit/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/swiftui-webkit/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-webkit -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/swiftui-webkit/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-webkit -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/swiftui-webkit/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install dpearson2699/swift-ios-skills swiftui-webkit
```

2. **Manually: put the files in place**
- File: `.github/skills/swiftui-webkit/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-webkit -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/dpearson2699/swift-ios-skills --path skills/swiftui-webkit
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/swiftui-webkit/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add dpearson2699/swift-ios-skills --skill swiftui-webkit -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/dpearson2699/swift-ios-skills/tree/HEAD/skills/swiftui-webkit/SKILL.md

## When to use it
- embed web content directly with native SwiftUI `WebView`
- track loading progress and headers using `@MainActor` `WebPage` state
- intercept external domain links using `NavigationDeciding`
- invoke JavaScript functions with structured Swift arguments

## Example prompts
- Show how to set up an article view using SwiftUI WebPage and WebView
- Implement a WebPage.NavigationDeciding policy that cancels external navigation
- Pass Swift arguments safely to callJavaScript and handle missing return values

## Similar
- [vercel-react-native-skills](https://affpapa.org/en/nevibecode/skills/vercel-react-native-skills.md) — skill · 255200 installs
- [animate-expo](https://affpapa.org/en/nevibecode/skills/animate-expo.md) — skill · 137900 installs
- [mobile-native](https://affpapa.org/en/nevibecode/skills/mobile-native.md) — skill · 86600 installs
- [aso](https://affpapa.org/en/nevibecode/skills/aso.md) — skill · 75400 installs
- [swiftui-pro](https://affpapa.org/en/nevibecode/skills/swiftui-pro.md) — skill · 35200 installs
- [orca-emulator](https://affpapa.org/en/nevibecode/skills/orca-emulator.md) — skill · 5800 installs

From the same set: [dpearson2699/swift-ios-skills](https://affpapa.org/en/nevibecode/by/dpearson2699/swift-ios-skills.md) — 86 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
