axiom-swiftui-26-ref

1
0
Source

Use when implementing iOS 26 SwiftUI features - covers Liquid Glass design system, performance improvements, @Animatable macro, 3D spatial layout, scene bridging, WebView/WebPage, AttributedString rich text editing, drag and drop enhancements, and visionOS integration for iOS 26+

Install

mkdir -p .claude/skills/axiom-swiftui-26-ref && curl -L -o skill.zip "https://mcp.directory/api/skills/download/7226" && unzip -o skill.zip -d .claude/skills/axiom-swiftui-26-ref && rm skill.zip

Installs to .claude/skills/axiom-swiftui-26-ref

About this skill

SwiftUI 26 Features

Overview

Comprehensive guide to new SwiftUI features in iOS 26, iPadOS 26, macOS Tahoe, watchOS 26, and visionOS 26. From the Liquid Glass design system to rich text editing, these enhancements make SwiftUI more powerful across all Apple platforms.

Core principle From low level performance improvements all the way up through the buttons in your user interface, there are some major improvements across the system.

When to Use This Skill

  • 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
  • Adjusting line height or baseline spacing for text

System Requirements

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


Liquid Glass Design System

For comprehensive coverage, see axiom-liquid-glass (design principles, variants, review pressure) and axiom-liquid-glass-ref (app-wide adoption guide). This 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: confirmationActionglassProminent 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 axiom-swiftui-search-ref. This 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 axiom-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.

lineHeight (iOS 26)

Sets the baseline-to-baseline distance between text lines. More intuitive than .lineSpacing() which measures bottom-of-line to top-of-next-line.

Presets

Text("Lore

---

*Content truncated.*

axiom-swiftdata

CharlesWiltgen

Use when working with SwiftData - @Model definitions, @Query in SwiftUI, @Relationship macros, ModelContext patterns, CloudKit integration, iOS 26+ features, and Swift 6 concurrency with @MainActor — Apple's native persistence framework

11

axiom-swiftui-nav-diag

CharlesWiltgen

Use when debugging navigation not responding, unexpected pops, deep links showing wrong screen, state lost on tab switch or background, crashes in navigationDestination, or any SwiftUI navigation failure - systematic diagnostics with production crisis defense

21

axiom-ios-build

CharlesWiltgen

Use when ANY iOS build fails, test crashes, Xcode misbehaves, or environment issue occurs before debugging code. Covers build failures, compilation errors, dependency conflicts, simulator problems, environment-first diagnostics.

151

axiom-ios-vision

CharlesWiltgen

Use when implementing ANY computer vision feature - image analysis, object detection, pose detection, person segmentation, subject lifting, hand/body pose tracking.

21

axiom-haptics

CharlesWiltgen

Use when implementing haptic feedback, Core Haptics patterns, audio-haptic synchronization, or debugging haptic issues - covers UIFeedbackGenerator, CHHapticEngine, AHAP patterns, and Apple's Causality-Harmony-Utility design principles from WWDC 2021

20

axiom-in-app-purchases

CharlesWiltgen

Use when implementing in-app purchases, StoreKit 2, subscriptions, or transaction handling - testing-first workflow with .storekit configuration, StoreManager architecture, transaction verification, subscription management, and restore purchases for consumables, non-consumables, and auto-renewable subscriptions

10

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

9521,094

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

846846

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

571700

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

548492

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

673466

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

514280

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.