/superskills-design:swiftui-webkitfrom Superskills Design
Embeds and controls web content in SwiftUI apps using WebView and WebPage. Covers URL/HTML display, JavaScript interop, navigation control, snapshots, and custom URL schemes.
Ships in Superskills Design. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Embed and control web content in SwiftUI using WebView and WebPage.
Use this skill when the user needs to:
| API | Minimum Version | Notes |
|---|---|---|
WebView | iOS/macOS 26 | Main SwiftUI web view |
WebPage | iOS/macOS 26 | Observable web page controller |
WebPage.Configuration | iOS/macOS 26 | Configuration object |
WKContentWorld | iOS 14 / macOS 11 | JavaScript execution worlds |
WKSnapshotConfiguration | iOS 11 / macOS 10.13 | Snapshot capture |
import SwiftUI
import WebKit
struct SimpleWebView: View {
var body: some View {
WebView(url: URL(string: "https://apple.com")!)
}
}
import SwiftUI
import WebKit
struct ControlledWebView: View {
@State private var page = WebPage()
var body: some View {
VStack {
HStack {
Button("Back") { page.goBack() }
.disabled(!page.canGoBack)
Button("Forward") { page.goForward() }
.disabled(!page.canGoForward)
Button("Reload") { page.reload() }
}
WebView(page)
}
.onAppear {
page.load(URLRequest(url: URL(string: "https://apple.com")!))
}
}
}
// Execute after page loads
let result = try await page.callJavaScript("document.title")
// Inject script
await page.evaluateJavaScript("document.body.style.backgroundColor = 'red'")
Wait for page load before executing JavaScript — check page.isLoading or observe load events.
page.load(URLRequest(url: url))
page.loadHTMLString("<h1>Hello</h1>", baseURL: nil)
page.goBack()
page.goForward()
page.reload()
page.stopLoading()
| # | Mistake | Fix |
|---|---|---|
| 1 | Using WebView(url:) when you need navigation control | Use WebPage for any interactivity |
| 2 | Missing import WebKit | Required alongside import SwiftUI |
| 3 | Not observing navigation events | Observe page.isLoading and navigation callbacks |
| 4 | Executing JavaScript before DOM is ready | Wait for page load completion |
| 5 | Using persistent data store in private mode | Use ephemeral data store for private browsing |
| 6 | String interpolation in JavaScript | Sanitize all user input before injecting into JS |
import WebKit present alongside import SwiftUIWebPage for any navigation or JavaScript needsWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub ariadoss/superskills --plugin superskills-design37 skills in this plugin
/adaptive-communicationAdjust communication style based on whether the user is in a relational (exploratory, hedging) or transactional (direct, technical) mode. Use when calibrating response tone, level of scaffolding, or how much to acknowledge context before answering./app-store-screenshotsGenerate App Store and Google Play marketing screenshots using Next.js. Use when the user wants to create app store screenshots, marketing screenshots, or device mockup exports for iOS, iPad, or Android./bencium-code-conventionsBence's code style, tech stack, and workflow conventionsOther plugins' skills for the same job