Token导航 LogoToken导航

Agent Skill · 研究检索

ios-swiftui-26-ref(iOS swiftui 26 REF 搜索)

ios-swiftui-26-ref 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

ios-swiftui-26-ref 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描有提醒项,按安装量在研究检索类的 73,675 个 Skill 里排第 67,016。

总安装 256周安装 11GitHub Stars 8下载 90核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ios-swiftui-26-ref(iOS swiftui 26 REF 搜索)
来源仓库:https://github.com/derklinke/codex-config
仓库路径:skills/ios-swiftui-26-ref
安装命令:
npx skills add https://github.com/derklinke/codex-config --skill ios-swiftui-26-ref
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/derklinke/codex-config --skill ios-swiftui-26-ref

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

该技能用于查找、检索和筛选相关信息。ios-swiftui-26-ref 属于研究检索类 Skill,可作为该场景下的辅助能力补充。适合在关键词搜索、任务场景匹配或线索筛选等场景使用。通过 npx skills add 命令从指定 GitHub 仓库安装并使用该技能。

安装前需确认权限范围和维护状态,避免触发不必要的联网操作。建议结合原始 README 了解具体检索范围和结果格式。

来源仓库内路径:skills/ios-swiftui-26-ref

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/derklinke/codex-config --skill ios-swiftui-26-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

ios-swiftui-26-ref 怎么安装?

在终端执行 npx skills add https://github.com/derklinke/codex-config --skill ios-swiftui-26-ref。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

ios-swiftui-26-ref 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

ios-swiftui-26-ref 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

ios-swiftui-26-ref 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

ios-swiftui-26-ref 用的人多吗?

公开数据是累计安装 256 次,近一周安装 11 次,下载 90 次,GitHub 8 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

ios-swiftui-26-ref 安全吗?

第三方扫描有提醒项,说明存在需要人工确认的行为。安装前请打开源码看清它读了什么、联网到哪里。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
ios-swiftui-26-ref

iOS swiftui 26 REF 搜索 · 本页

2568操作浏览器未明确有提醒

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

SwiftUI 26 Features

Overview

Guide to SwiftUI 26 additions across Apple platforms, from Liquid Glass to rich text, scene bridging, and web embedding.

Core principle: iOS 26 updates span the full stack; adopt APIs deliberately from rendering/performance layers up to control-level behavior.

When to Use

  • Adopting the Liquid Glass design system
  • Implementing rich text editing with AttributedString
  • Embedding web content with WebView
  • Optimizing list and scrolling performance
  • Using the @Animatable macro for custom animations
  • Building 3D spatial layouts on visionOS
  • Bridging SwiftUI scenes to UIKit/AppKit apps
  • Implementing drag and drop with multiple items
  • Creating 3D charts with Chart3D
  • Adding widgets to visionOS or CarPlay
  • Adding custom tick marks to sliders (chapter markers, value indicators)
  • Constraining slider selection ranges with enabledBounds
  • Customizing slider appearance (thumb visibility, current value labels)
  • Creating sticky safe area bars with blur effects
  • Opening URLs in in-app browser
  • Using system-styled close and confirm buttons
  • Applying glass button styles (iOS 26.1+)
  • Controlling button sizing behavior
  • Implementing compact search toolbars

System Requirements

iOS 26+, iPadOS 26+, macOS Tahoe+, watchOS 26+, visionOS 26+

Liquid Glass Design System

For comprehensive coverage, see ios-liquid-glass (design principles, variants, review pressure) and ios-liquid-glass-ref (app-wide adoption guide). Section covers WWDC 256-specific APIs only.

Automatic Adoption

Recompile with iOS 26 SDK — navigation containers, tab bars, toolbars, toggles, segmented pickers, and sliders automatically adopt the new design. Bordered buttons default to capsule shape. Sheets get Liquid Glass background (remove any presentationBackground customizations).

Toolbar APIs (iOS 26)

ToolbarSpacer
.toolbar {
    ToolbarItem(placement: .bottomBar) { Button("Archive", systemImage: "archivebox") { } }
    ToolbarSpacer(.flexible, placement: .bottomBar)  // Push items apart
    ToolbarItem(placement: .bottomBar) { Button("Compose", systemImage: "square.and.pencil") { } }
}
// .fixed separates groups visually; .flexible pushes apart (like Spacer in HStack)
ToolbarItemGroup (Visual Grouping)

Items in a ToolbarItemGroup share a single glass background "pill". ToolbarItemPlacement controls visual appearance: confirmationAction → glassProminent styling, cancellationAction → standard glass. Use .sharedBackgroundVisibility(.hidden) to exclude items (e.g., avatars) from group background.

Toolbar Morphing

Attach .toolbar {} to individual views inside NavigationStack (not to NavigationStack itself). iOS 26 morphs between per-view toolbars during push/pop. Use toolbar(id:) with matching ToolbarItem(id:) across screens for items that should stay stable (no bounce):

// MailboxList
.toolbar(id: "main") {
    ToolbarItem(id: "filter", placement: .bottomBar) { Button("Filter") { } }
    ToolbarSpacer(.flexible, placement: .bottomBar)
    ToolbarItem(id: "compose", placement: .bottomBar) { Button("New Message") { } }
}
// MessageList — "filter" absent (animates out), "compose" stays stable
.toolbar(id: "main") {
    ToolbarSpacer(.flexible, placement: .bottomBar)
    ToolbarItem(id: "compose", placement: .bottomBar) { Button("New Message") { } }
}

#1 gotcha: Toolbar on NavigationStack = nothing to morph between.

DefaultToolbarItem

Reposition system-provided items (like search) within your toolbar layout:

DefaultToolbarItem(kind: .search, placement: .bottomBar)
// Replaces system's default placement of matching kind

Use in collapsed NavigationSplitView sidebar to specify which column shows search on iPhone. Wrap in if #available(iOS 26.0, *) for backward compatibility.

User-Customizable Toolbars

toolbar(id:) enables user customization (rearrange, show/hide). Only .secondaryAction items support customization on iPadOS. Use showsByDefault: false for optional items. Add ToolbarCommands() for macOS menu item.

Other Toolbar Features
  • .navigationSubtitle("3 unread") — Secondary line below title
  • .badge(3) on toolbar items — Notification counts
  • Monochrome icon rendering — Reduces visual noise; tint for meaning, not decoration
  • Scroll edge blur — Automatic, no code required

Bottom-Aligned Search

Foundational search APIs: See ios-swiftui-search-ref. Section covers iOS 26 refinements only.

NavigationSplitView {
    List { }.searchable(text: $searchText)
}
// Bottom-aligned on iPhone, top trailing on iPad (automatic)
// Use placement: .sidebar to restore sidebar-embedded search on iPad
  • searchToolbarBehavior(.minimize) — Compact search that expands on tap
  • Tab(role:.search) — Dedicated search tab; search field replaces tab bar. See swiftui-nav-ref Section 5.7

Glass Effect for Custom Views

Button("To Top", systemImage: "chevron.up") { scrollToTop() }
    .padding()
    .glassEffect()  // Add .interactive for custom controls on iOS
  • GlassEffectContainer — Required when multiple glass elements are nearby (glass can't sample glass)
  • glassEffectID(_:in:) — Fluid morphing transitions between glass elements using a namespace
  • Sheet morphing — Use .matchedTransitionSource + .navigationTransition(.zoom(...)) to morph sheets from buttons

Button & Control Changes

  • Capsule shape default for bordered buttons (override with .buttonBorderShape(.roundedRectangle))
  • .controlSize(.extraLarge) — New extra-large button size
  • .controlSize(.small) on containers — Preserve pre-iOS 26 density
  • GlassButtonStyle(.clear/.glass/.tint) — Glass button variants (iOS 26.1+)
  • .buttonSizing(.fit/.stretch/.flexible) — Control button layout behavior
  • Button(role:.close) / Button(role:.confirm) — System-styled close/confirm
  • .clipShape(.rect(cornerRadius: 12, style:.containerConcentric)) — Corner concentricity
  • Menus: icons on leading edge, consistent iOS/macOS

Slider Enhancements

iOS 26 adds custom tick marks, constrained selection ranges, current value labels, and thumb visibility control.

Slider Ticks

Core types: SliderTick<V>, SliderTickContentForEach, SliderTickBuilder

// Static ticks with labels
Slider(value: $value, in: 0...10) {
    Text("Rating")
} ticks: {
    SliderTick(0) { Text("Min") }
    SliderTick(5) { Text("Mid") }
    SliderTick(10) { Text("Max") }
}

// Dynamic ticks from collection
SliderTickContentForEach(stops, id: \.self) { value in
    SliderTick(value) { Text("\(Int(value))°").font(.caption2) }
}

// Step-based ticks (called for each step value)
Slider(value: $volume, in: 0...10, step: 2, label: { Text("Volume") }, tick: { value in
    SliderTick(value) { Text("\(Int(value))") }
})

API constraint: SliderTickContentForEach requires Data.Element to match SliderTick<V> value type. For custom structs, extract numeric values: chapters.map(\.time) then look up labels via chapters.first(where: {$0.time == time}).

Full-Featured Slider

Slider(
    value: $rating, in: 0...100,
    neutralValue: 50,           // Starting point / center value
    enabledBounds: 20...80,     // Restrict selectable range
    label: { Text("Rating") },
    currentValueLabel: { Text("\(Int(rating))") },
    minimumValueLabel: { Text("0") },
    maximumValueLabel: { Text("100") },
    ticks: { SliderTick(50) { Text("Mid") } },
    onEditingChanged: { editing in print(editing ? "Started" : "Ended") }
)

sliderThumbVisibility

.sliderThumbVisibility(.hidden) — Hide thumb for media progress indicators and minimal UI. Options: .automatic, .visible, .hidden. Always visible on watchOS.


New View Modifiers

safeAreaBar

Sticky bars with integrated progressive blur:

List { ForEach(1...20, id: \.self) { Text("\($0). Item") } }
    .safeAreaBar(edge: .bottom) {
        Text("Bottom Action Bar").padding(.vertical, 15)
    }
    .scrollEdgeEffectStyle(.soft, for: .bottom) // or .hard

Works like safeAreaInset but with blur. Bar remains fixed while content scrolls beneath.

onOpenURL Enhancement

@Environment(\.openURL) var openURL
// openURL(url, prefersInApp: true) — Opens in SFSafariViewController-style in-app browser
// Default Link opens in Safari; prefersInApp keeps users in your app

searchToolbarBehavior

See ios-swiftui-search-ref for foundational .searchable APIs. iOS 26 adds:

.searchable(text: $searchText)
.searchToolbarBehavior(.minimize)  // Compact button, expands on tap

Also: .searchPresentationToolbarBehavior(.avoidHidingContent) (iOS 17.1+) keeps title visible during search.

Backward-compatible wrapper for apps targeting iOS 18+26:

extension View {
    @ViewBuilder func minimizedSearch() -> some View {
        if #available(iOS 26.0, *) {
            self.searchToolbarBehavior(.minimize)
        } else { self }
    }
}

// Usage
.searchable(text: $searchText)
.minimizedSearch()

Availability pattern for toolbar items:

.toolbar {
    if #available(iOS 26.0, *) {
        DefaultToolbarItem(kind: .search, placement: .bottomBar)
        ToolbarSpacer(.flexible, placement: .bottomBar)
    }
    ToolbarItem(placement: .bottomBar) {
        NewNoteButton()
    }
}
.searchable(text: $searchText)

Button roles, GlassButtonStyle, buttonSizing — See Liquid Glass Design System section above.


iPad Enhancements

Menu Bar

Access common actions via swipe-down menu
.commands {
    TextEditingCommands() // Same API as macOS menu bar

    CommandGroup(after: .newItem) {
        Button("Add Note") {
            addNote()
        }
        .keyboardShortcut("n", modifiers: [.command, .shift])
    }
}
// Creates menu bar on iPad when people swipe down

Resizable Windows

Fluid resizing on iPad
// MIGRATION REQUIRED:
// Remove deprecated property list key in iPadOS 26:
// UIRequiresFullscreen (entire key deprecated, all values)

// For split view navigation, system automatically shows/hides columns
// based on available space during resize
NavigationSplitView {
    Sidebar()
} detail: {
    Detail()
}
// Adapts to resizing automatically

Reference "Elevate the design of your iPad app" (WWDC 2025)


macOS Window Enhancements

Synchronized Window Resize Animations

.windowResizeAnchor(.topLeading) // Tailor where animation originates

// SwiftUI now synchronizes animation between content view size changes
// and window resizing - great for preserving continuity when switching tabs

Performance Improvements

List Performance (macOS Focus)

Massive gains for large lists
  • 6x faster loading for lists of 100,000+ items on macOS
  • 16x faster updates for large lists
  • Even bigger gains for larger lists
  • Improvements benefit all platforms (iOS, iPadOS, watchOS)
List(trips) { trip in // 100k+ items
    TripRow(trip: trip)
}
// Loads 6x faster, updates 16x faster on macOS (iOS 26+)

Scrolling Performance

Reduced dropped frames

SwiftUI has improved scheduling of user interface updates on iOS and macOS. This improves responsiveness and lets SwiftUI do even more work to prepare for upcoming frames. All in all, it reduces the chance of your app dropping a frame while scrolling quickly at high frame rates.

Nested ScrollViews with Lazy Stacks

Photo carousels and multi-axis scrolling
ScrollView(.horizontal) {
    LazyHStack {
        ForEach(photoSets) { photoSet in
            ScrollView(.vertical) {
                LazyVStack {
                    ForEach(photoSet.photos) { photo in
                        PhotoView(photo: photo)
                    }
                }
            }
        }
    }
}
// Nested scrollviews now properly delay loading with lazy stacks
// Great for building photo carousels

SwiftUI Performance Instrument

New profiling tool in Xcode

Available lanes:

  • Long view body updates — Identify expensive body computations
  • Platform view updates — Track UIKit/AppKit bridging performance
  • Other performance problem areas

Reference "Optimize SwiftUI performance with instruments" (WWDC 2025)

Cross-reference SwiftUI Performance — Master the SwiftUI Instrument


Swift Concurrency Integration

Compile-Time Data Race Safety

@Observable
class TripStore {
    var trips: [Trip] = []

    func loadTrips() async {
        trips = await TripService.fetchTrips()
        // Swift 6 verifies data race safety at compile time
    }
}

Benefits Find bugs in concurrent code before they affect your app

References
  • "Embracing Swift concurrency" (WWDC 2025)
  • "Explore concurrency in SwiftUI" (WWDC 2025)

Cross-reference Swift Concurrency — Swift 6 strict concurrency patterns


@Animatable Macro

Overview

Simplifies custom animations by automatically synthesizing animatableData property.

Before (@Animatable macro)
struct HikingRouteShape: Shape {
    var startPoint: CGPoint
    var endPoint: CGPoint
    var elevation: Double
    var drawingDirection: Bool // Don't want to animate this

    // Tedious manual animatableData declaration
    var animatableData: AnimatablePair<CGPoint.AnimatableData,
                        AnimatablePair<Double, CGPoint.AnimatableData>> {
        get {
            AnimatablePair(startPoint.animatableData,
                          AnimatablePair(elevation, endPoint.animatableData))
        }
        set {
            startPoint.animatableData = newValue.first
            elevation = newValue.second.first
            endPoint.animatableData = newValue.second.second
        }
    }
}
After (@Animatable macro)
@Animatable
struct HikingRouteShape: Shape {
    var startPoint: CGPoint
    var endPoint: CGPoint
    var elevation: Double

    @AnimatableIgnored
    var drawingDirection: Bool // Excluded from animation

    // animatableData automatically synthesized!
}
Key benefits
  • Delete manual animatableData property
  • Use @AnimatableIgnored for properties to exclude
  • SwiftUI automatically synthesizes animation data

Cross-reference SwiftUI Animation (swiftui-animation-ref skill) — Comprehensive animation guide covering VectorArithmetic, Animatable protocol, @Animatable macro, animation types, Transaction system, and performance optimization


3D Spatial Layout (visionOS)

Alignment3D

Depth-based layout
struct SunPositionView: View {
    @State private var timeOfDay: Double = 12.0

    var body: some View {
        HikingRouteView()
            .overlay(alignment: sunAlignment) {
                SunView()
                    .spatialOverlay(alignment: sunAlignment)
            }
    }

    var sunAlignment: Alignment3D {
        // Align sun in 3D space based on time of day
        Alignment3D(
            horizontal: .center,
            vertical: .top,
            depth: .back
        )
    }
}

Manipulable Modifier

Interactive 3D objects
Model3D(named: "WaterBottle")
    .manipulable() // People can pick up and move the object

Surface Snapping APIs

@Environment(\.surfaceSnappingInfo) var snappingInfo: SurfaceSnappingInfo

var body: some View {
    VStackLayout().depthAlignment(.center) {
        Model3D(named: "waterBottle")
            .manipulable()

        Pedestal()
            .opacity(snappingInfo.classification == .table ? 1.0 : 0.0)
    }
}
References
  • "Meet SwiftUI spatial layout" (WWDC 2025)
  • "Set the scene with SwiftUI in visionOS" (WWDC 2025)
  • "What's new in visionOS" (WWDC 2025)

Scene Bridging

Overview

Scene bridging allows your UIKit and AppKit lifecycle apps to interoperate with SwiftUI scenes. Apps can use it to open SwiftUI-only scene types or use SwiftUI-exclusive features right from UIKit or AppKit code.

Supported Scene Types

From UIKit/AppKit apps, you can now use
  • MenuBarExtra (macOS)
  • ImmersiveSpace (visionOS)
  • RemoteImmersiveSpace (macOS → Vision Pro)
  • AssistiveAccess (iOS 26)

Scene Modifiers

Works with scene modifiers like:

  • .windowStyle()
  • .immersiveEnvironmentBehavior()

RemoteImmersiveSpace

Mac app renders stereo content on Vision Pro
// In your macOS app
@main
struct MyMacApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }

        RemoteImmersiveSpace(id: "stereoView") {
            // Render stereo content on Apple Vision Pro
            // Uses CompositorServices
        }
    }
}
Features
  • Mac app renders stereo content on Vision Pro
  • Hover effects and input events supported
  • Uses CompositorServices and Metal

Reference "What's new in Metal rendering for immersive apps" (WWDC 2025)

AssistiveAccess Scene

Special mode for users with cognitive disabilities
@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            ContentView()
        }

        AssistiveAccessScene {
            SimplifiedUI() // UI shown when iPhone is in AssistiveAccess mode
        }
    }
}

Reference "Customize your app for Assistive Access" (WWDC 2025)


AppKit Integration Enhancements

SwiftUI Sheets in AppKit

// Show SwiftUI view in AppKit sheet
let hostingController = NSHostingController(rootView: SwiftUISettingsView())
presentAsSheet(hostingController)
// Great for incremental SwiftUI adoption

NSGestureRecognizerRepresentable

// Bridge AppKit gestures to SwiftUI
struct AppKitPanGesture: NSGestureRecognizerRepresentable {
    func makeNSGestureRecognizer(context: Context) -> NSPanGestureRecognizer {
        NSPanGestureRecognizer()
    }

    func updateNSGestureRecognizer(_ recognizer: NSPanGestureRecognizer, context: Context) {
        // Update configuration
    }
}

NSHostingView in Interface Builder

NSHostingView can now be used directly in Interface Builder for gradual SwiftUI adoption.


RealityKit Integration

Observable Entities

@Observable
class RealityEntity {
    var position: SIMD3<Float>
    var rotation: simd_quatf
}

struct MyView: View {
    @State private var entity = RealityEntity()

    var body: some View {
        // SwiftUI views automatically observe changes
        Text("Position: \(entity.position.x)")
    }
}

PresentationComponent

Present SwiftUI popovers, alerts, and sheets directly from RealityKit entities.

// Present SwiftUI popovers from RealityKit entities
let popover = Entity()
mapEntity.addChild(popover)
popover.components[PresentationComponent.self] = PresentationComponent(
    isPresented: $popoverPresented,
    configuration: .popover(arrowEdge: .bottom),
    content: DetailsView()
)

Additional Improvements

  • ViewAttachmentComponent — add SwiftUI views to entities
  • GestureComponent — entity touch and gesture responsiveness
  • Enhanced coordinate conversion API
  • Synchronizing animations, binding to components
  • New sizing behaviors for RealityView

Reference "Better Together: SwiftUI & RealityKit" (WWDC 2025)


WebView & WebPage

Overview

WebKit now provides full SwiftUI APIs for embedding web content, eliminating the need to drop down to UIKit.

WebView

Display web content
import WebKit

struct ArticleView: View {
    let articleURL: URL

    var body: some View {
        WebView(url: articleURL)
    }
}

WebPage (Observable Model)

Rich interaction with web content
import WebKit

struct InAppBrowser: View {
    @State private var page = WebPage()

    var body: some View {
        VStack {
            Text(page.title ?? "Loading...")

            WebView(page)
                .ignoresSafeArea()
                .onAppear {
                    page.load(URLRequest(url: articleURL))
                }

            HStack {
                Button("Back") { page.goBack() }
                    .disabled(!page.canGoBack)
                Button("Forward") { page.goForward() }
                    .disabled(!page.canGoForward)
            }
        }
    }
}
WebPage features
  • Programmatic navigation (goBack(), goForward())
  • Access page properties (title, url, canGoBack, canGoForward)
  • Observable — SwiftUI views update automatically

Advanced WebKit Features

  • Custom user agents
  • JavaScript execution
  • Custom URL schemes
  • And more

Reference "Meet WebKit for SwiftUI" (WWDC 2025)


TextEditor with AttributedString

Overview

SwiftUI's new support for rich text editing is great for experiences like commenting on photos. TextView now supports AttributedString!

Note The WWDC transcript uses "TextView" as editorial language. The actual SwiftUI API is TextEditor which now supports AttributedString binding for rich text editing.

Rich Text Editing

struct CommentView: View {
    @State private var comment = AttributedString("Enter your comment")

    var body: some View {
        TextEditor(text: $comment)
            // Built-in text formatting controls included
            // Users can apply bold, italic, underline, etc.
    }
}
Features
  • Built-in text formatting controls (bold, italic, underline, colors, etc.)
  • Binding to AttributedString preserves formatting
  • Automatic toolbar with formatting options

Advanced AttributedString Features

Customization options
  • Paragraph styles
  • Attribute transformations
  • Constrain which attributes users can apply

Reference "Cook up a rich text experience in SwiftUI with AttributedString" (WWDC 2025)

Cross-reference App Intents Integration (app-intents-ref skill) — AttributedString for Apple Intelligence Use Model action


Drag and Drop Enhancements

Multiple Item Dragging

Drag multiple items based on selection
struct PhotoGrid: View {
    @State private var selectedPhotos: [Photo.ID] = []

    var body: some View {
        ScrollView {
            LazyVGrid(columns: gridColumns) {
                ForEach(model.photos) { photo in
                    view(photo: photo)
                        .draggable(containerItemID: photo.id)
                }
            }
        }
        .dragContainer(for: Photo.self, selection: selectedPhotos) { draggedIDs in
            photos(ids: draggedIDs)
        }
    }
}

Key APIs:

  • .draggable(containerItemID:containerNamespace:) marks each item as part of a drag container (namespace defaults to nil)
  • .dragContainer(for:selection:) provides the typed items lazily when a drop occurs

DragConfiguration

Customize supported operations
.dragConfiguration(DragConfiguration(allowMove: false, allowDelete: true))

Observing Drag Events

.onDragSessionUpdated { session in
    let ids = session.draggedItemIDs(for: Photo.ID.self)
    if session.phase == .ended(.delete) {
        trash(ids)
        deletePhotos(ids)
    }
}

Drag Preview Formations

.dragPreviewsFormation(.stack) // Items stack nicely on top of one another

// Other formations:
// - .default
// - .grid
// - .stack

Combine all modifiers (.dragContainer, .dragConfiguration, .dragPreviewsFormation, .onDragSessionUpdated) on the same scroll view for a complete multi-item drag experience.


3D Charts

Overview

Swift Charts now supports three-dimensional plotting with Chart3D.

Basic Usage

From WWDC 256:21:35
import Charts

struct HikePlotView: View {
    var body: some View {
        Chart3D {
            SurfacePlot(x: "x", y: "y", z: "z") { x, y in
                sin(x) * cos(y)
            }
            .foregroundStyle(Gradient(colors: [.orange, .pink]))
        }
        .chartXScale(domain: -3...3)
        .chartYScale(domain: -3...3)
        .chartZScale(domain: -3...3)
    }
}
Features
  • Chart3D container
  • SurfacePlot for continuous surface rendering from a function
  • Z-axis specific modifiers (.chartZScale(), .chartZAxis(), etc.)
  • All existing chart marks with 3D variants (e.g., LineMark3D)

Reference "Bring Swift Charts to the third dimension" (WWDC 2025)


Widgets & Controls

Controls on watchOS and macOS

watchOS 26
struct FavoriteLocationControl: ControlWidget {
    var body: some ControlWidgetConfiguration {
        StaticControlConfiguration(kind: "FavoriteLocation") {
            ControlWidgetButton(action: MarkFavoriteIntent()) {
                Label("Mark Favorite", systemImage: "star")
            }
        }
    }
}
// Access from watch face or Shortcuts
macOS

Controls now appear in Control Center on Mac.

Widgets on visionOS

Level of detail customization
struct CountdownWidget: Widget {
    var body: some WidgetConfiguration {
        StaticConfiguration(kind: "Countdown") { entry in
            CountdownView(entry: entry)
        }
    }
}

struct PhotoCountdownView: View {
    @Environment(\.levelOfDetail) var levelOfDetail: LevelOfDetail

    var body: some View {
        switch levelOfDetail {
        case .default:
            RecentPhotosView() // Full detail when close
        case .simplified:
            CountdownView()   // Simplified when further away
        default:
            CountdownView()
        }
    }
}

Widgets on CarPlay

Live Activities on CarPlay

Live Activities now appear on CarPlay displays for glanceable information while driving.

Additional Widget Features

  • Push-based updating API
  • New relevance APIs for watchOS

Reference "What's new in widgets" (WWDC 2025)


Migration Checklist

Deprecated APIs

❌ Remove in iPadOS 26
<key>UIRequiresFullscreen</key>
<!-- Entire property list key is deprecated (all values) -->

Apps must support resizable windows on iPad.

Automatic Adoptions (Recompile Only)

✅ Liquid Glass design for navigation, tab bars, toolbars ✅ Bottom-aligned search on iPhone ✅ List performance improvements (6x loading, 16x updating) ✅ Scrolling performance improvements ✅ System controls (toggles, pickers, sliders) new appearance ✅ Bordered buttons default to capsule shape ✅ Updated control heights (slightly taller on macOS) ✅ Monochrome icon rendering in toolbars ✅ Menus: icons on leading edge, consistent across iOS and macOS ✅ Sheets morph out of dialogs automatically ✅ Scroll edge blur/fade under system toolbars

Audit Items (Remove Old Customizations)

⚠️ Remove presentationBackground from sheets (let Liquid Glass material shine) ⚠️ Remove extra backgrounds/darkening effects behind toolbar areas ⚠️ Remove hard-coded control heights (use automatic sizing) ⚠️ Update section headers to title-style capitalization (no longer auto-uppercased)

Manual Adoptions (Code Changes)

🔧 Toolbar spacers (.fixed) 🔧 Tinted prominent buttons in toolbars 🔧 Glass effect for custom views (.glassEffect()) 🔧 glassEffectID for morphing transitions between glass elements 🔧 GlassEffectContainer for multiple nearby glass elements 🔧 sharedBackgroundVisibility(.hidden) to remove toolbar item from group background 🔧 Sheet morphing from buttons (navigationZoomTransition) 🔧 Search tab role (Tab(role:.search)) 🔧 Compact search toolbar (.searchToolbarBehavior(.minimize)) 🔧 Extra large buttons (.controlSize(.extraLarge)) 🔧 Concentric rectangle shape (.containerConcentric) 🔧 iPad menu bar (.commands) 🔧 Window resize anchor (.windowResizeAnchor()) 🔧 @Animatable macro for custom shapes/modifiers 🔧 WebView for web content 🔧 TextEditor with AttributedString binding 🔧 Enhanced drag and drop with .dragContainer 🔧 Slider ticks (SliderTick, SliderTickContentForEach) 🔧 Slider thumb visibility (.sliderThumbVisibility()) 🔧 Safe area bars with blur (.safeAreaBar() + .scrollEdgeEffectStyle()) 🔧 In-app URL opening (openURL(url, prefersInApp: true)) 🔧 Close and confirm button roles (Button(role:.close)) 🔧 Glass button styles (GlassButtonStyle — iOS 26.1+) 🔧 Button sizing control (.buttonSizing()) 🔧 Toolbar morphing transitions (per-view .toolbar {} inside NavigationStack) 🔧 DefaultToolbarItem for system components in toolbars 🔧 Stable toolbar items (toolbar(id:) with matched IDs across screens) 🔧 User-customizable toolbars (toolbar(id:) with CustomizableToolbarContent) 🔧 Tab bar minimization (.tabBarMinimizeBehavior(.onScrollDown)) 🔧 Tab view bottom accessory (.tabViewBottomAccessory(isEnabled:content:) — iOS 26.1+)


Best Practices

  • Performance: Profile with new SwiftUI Instrument; use lazy stacks in nested ScrollViews; trust automatic list performance improvements
  • Liquid Glass: Recompile and test first; use toolbar spacers; attach .toolbar {} to individual views (not NavigationStack); remove presentationBackground from sheets; use GlassEffectContainer for nearby glass elements
  • Layout: Use .safeAreaPadding() for edge-to-edge (not .padding()). See ios-swiftui-layout-ref for full guide
  • Rich Text: Bind AttributedString to TextEditor; constrain attributes for your UX
  • Spatial (visionOS): Use Alignment3D for depth; .manipulable() only where it makes sense

Troubleshooting

SymptomFix
Old design after updating to iOS 26 SDKClean build (Shift-Cmd-K), rebuild targeting iOS 26 SDK, check deployment target
Search remains at top on iPhonePlace .searchable on NavigationSplitView, not on List directly
@Animatable "does not conform"All properties must be VectorArithmetic or marked @AnimatableIgnored
Rich text formatting lost in TextEditorBind AttributedString, not String
Drag delete not workingEnable .dragConfiguration(allowDelete: true) AND observe .onDragSessionUpdated
SliderTickContentForEach won't compileIterate over numeric values (chapters.map(\.time)), not custom structs — see Slider section
Toolbar not morphing during navigationMove .toolbar {} from NavigationStack to each view inside it — see Liquid Glass section

Resources

WWDC: 2025-256, 2025-278 (What's new in widgets), 2025-287 (Meet WebKit for SwiftUI), 2025-310 (Optimize SwiftUI performance with instruments), 2025-323 (Build a SwiftUI app with the new design), 2025-325 (Bring Swift Charts to the third dimension), 2025-341 (Cook up a rich text experience in SwiftUI with AttributedString)

Docs: /swiftui, /swiftui/defaulttoolbaritem, /swiftui/toolbarspacer, /swiftui/searchtoolbarbehavior, /swiftui/view/toolbar(id:content:), /swiftui/view/tabbarminimizebehavior(_:), /swiftui/view/tabviewbottomaccessory(isenabled:content:), /swiftui/slider, /swiftui/slidertick, /swiftui/slidertickcontentforeach, /webkit, /foundation/attributedstring, /charts, /realitykit/presentationcomponent, /swiftui/chart3d

Skills: ios-swiftui-performance, ios-liquid-glass, ios-swift-concurrency, ios-app-intents-ref, ios-swiftui-search-ref


Primary source WWDC 2025-256 "What's new in SwiftUI". Additional content from 2025-323 (Build a SwiftUI app with the new design), 2025-287 (Meet WebKit for SwiftUI), and Apple documentation. Version iOS 26+, iPadOS 26+, macOS Tahoe+, watchOS 26+, visionOS 26+

平台分布

Codex

37.82%
按下载量换算34

Claude

29.59%
按下载量换算27

Cursor

20.37%
按下载量换算18

Gemini CLI

8.93%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills