SwiftUI 26 Reference
Complete API reference for the SwiftUI features introduced in iOS 26, plus the 27-cycle additions that build on them. Covers Liquid Glass, performance, the @Animatable macro, WebView, rich text editing, 3D charts and spatial layout.
When to Use This Reference
Use this reference when you need:
- Liquid Glass APIs and toolbar patterns
- Toolbar transitions and morphing during navigation
- Performance improvements in iOS 26
- The
@Animatablemacro for custom animation WebViewandWebPageintegrationTextEditorwithAttributedStringChart3Dfor 3D data visualization- Spatial layout and scene bridging
- List section index and section margins
- Slider ticks, safe area bars, or line height control
- Multi-item drag and drop (27 cycle)
- A checklist for moving an app to the iOS 26 SDK
Example Prompts
Questions you can ask your assistant that will draw from this reference:
- "What Liquid Glass APIs are available in iOS 26?"
- "How do I keep nested corners concentric with their container in iOS 26?"
- "How should a custom bottom sheet's corners match the iPhone's screen corners?"
- "How do I use the
@Animatablemacro?" - "How do I embed web content with
WebViewin SwiftUI?" - "How do I intercept form submissions in a SwiftUI
WebView?" - "Why does my
WebViewscroll wrong inside aNavigationStack?" - "How do I use
TextEditorwithAttributedString?" - "How do I make links, phone numbers, and addresses tappable in SwiftUI text?"
- "How do I create 3D charts in SwiftUI?"
- "What performance improvements does iOS 26 bring to SwiftUI?"
- "How do I make toolbars morph during navigation transitions?"
- "Why isn't my toolbar morphing when I push a new view?"
- "How do I add the A–Z index strip to a SwiftUI
List?" - "Why isn't my section index showing up?"
- "How do I change the margins around a
Listsection?"
What's Covered
Liquid Glass Design
- Automatic adoption on recompile
ToolbarSpacer,ToolbarItemGroupshared glass backgrounds,sharedBackgroundVisibility(_:)- Toolbar morphing during
NavigationStackpush and pop;toolbar(id:)stable items DefaultToolbarItem, andDefaultToolbarItem+ToolbarSpacerbottom bar patterns- User-customizable toolbars (
CustomizableToolbarContent) navigationSubtitle(_:),.badge()on toolbar items, monochrome icons, scroll edge blur- Bottom-aligned search fields (with the
.sidebarplacement escape hatch) searchToolbarBehavior(.minimize)with a backward-compatible wrapper- Search tab with
Tab(role: .search)(iOS 18+), and the.onGeometryChangebug that breaks its morph .glassEffect(),GlassEffectContainer,glassEffectID(_:in:), sheet morphing- Button changes:
.glass/.glassProminentstyles,Button(role: .close)/.confirm,buttonSizing(_:),.controlSize(.extraLarge)
Corner Concentricity
ConcentricRectangleshape and.rect(corners:isUniform:)sugarEdge.Corner.Style(.fixed,.concentric,.concentric(minimum:))- Per-corner and per-edge initializer variants
RoundedRectangularShapeprotocolGeometryProxy.containerCornerInsets;concentricCornerRadii(iOS 27)- Matching the device's screen corners without a hard-coded radius; custom bottom sheets (fixed top corners, concentric bottom corners)
Sliders, Text and View Modifiers
SliderTick,SliderTickContentForEach,enabledBounds,neutralValue,sliderThumbVisibility(_:)safeAreaBar(edge:)withscrollEdgeEffectStyle(_:for:)openURL(_:prefersInApp:)lineHeight(_:)presets and precise values, including onAttributedString
Lists
sectionIndexLabel(_:)– per-section entry in the A–Z indexlistSectionIndexVisibility(_:)– override the index strip's visibility- Default visibility behavior, and excluding sections from the index
- Deriving index labels across languages (
UILocalizedIndexedCollation) listSectionMargins(_:_:)– override a section's margins- Platform availability, including where each API is unavailable
Data Detection (iOS 27)
.dataDetection(_:options:)– makes links, phone numbers, addresses, dates, and money in a view's text tappable (iOS / watchOS / visionOS 27 only — not macOS or tvOS)DataDetector.MatchTypeoptions from the DataDetection framework (iOS 26+), andString.dataDetectorMatches(_:options:)for detection without UI
Performance Improvements
- Lists of 100,000+ items on macOS load 6x faster and update 16x faster, with gains on every platform
- Fewer dropped frames while scrolling
- Nested
ScrollViews with lazy stacks - The SwiftUI instrument in Instruments 26 (long view body updates, platform view updates)
@Animatable Macro
- Automatic
animatableDatasynthesis @AnimatableIgnoredfor excluded properties- Which property types the macro can synthesize, and the error when one can't be
WebView Integration
WebViewfor URL contentWebPageobservable model – title, URL, loading progress, back-forward list- Navigation and load status handling
- JavaScript execution, custom user agents and custom URL schemes
- Scroll control –
webViewScrollPosition(_:),webViewOnScrollGeometryChange(for:of:action:),webViewScrollInputBehavior(_:for:)(available on iOS but not callable there — noScrollInputKindvalue exists) - Appearance and gestures –
webViewContentBackground(_:),webViewBackForwardNavigationGestures(_:),webViewMagnificationGestures(_:),webViewLinkPreviews(_:),webViewElementFullscreenBehavior(_:),webViewTextSelection(_:), and the macOS-onlywebViewContextMenu(_:) - WebView inside NavigationStack – safe-area and toolbar interaction, and why
.ignoresSafeArea()is wrong there - Form-submission hook (iOS/macOS/visionOS 27) –
WebPage.FormInfo,willSubmit(formInfo:),NavigationPreferences.alternateRequest/overrideReferrer/isGlobalPrivacyControlEnabled/allowsJSHandleCreationInPageWorld - No
WebVieworWebPageon tvOS
Rich Text Editing
TextEditorbound toAttributedString, with built-in formatting controlsTextFieldwithaxis: .verticalfor plain text- Paragraph styles, attribute transformations, and constraining which attributes users can apply
Drag and Drop (27 Cycle)
draggable(containerItemID:),dragContainer(for:),dragContainerSelection(_:)DragConfiguration,onDragSessionUpdated,dragPreviewsFormation(_:)(macOS)
3D Charts
Chart3Dcontainer, with closures or data collectionsSurfacePlot, surface styling (.heightBased,.normalBased, roughness)Chart3DPosecamera control andChart3DCameraProjection- Z-axis modifiers (
chartZScale,chartZAxis)
Spatial Layout (visionOS)
Alignment3DwithspatialOverlay(alignment:content:).manipulable()and surface snapping
Scene Bridging and Framework Integration
- SwiftUI-only scenes from UIKit and AppKit apps:
MenuBarExtra,ImmersiveSpace,RemoteImmersiveSpace,AssistiveAccess - AppKit: SwiftUI sheets via
NSHostingController,NSGestureRecognizerRepresentable,NSHostingViewin Interface Builder - RealityKit: observable entities,
PresentationComponent,ViewAttachmentComponent,GestureComponent - iPad menu bar (
.commands) and resizable windows; macOSwindowResizeAnchor(_:)
Widgets and Controls
- Controls on watchOS and in the macOS Control Center
- visionOS widget
levelOfDetail, Live Activities on CarPlay
Migration and Troubleshooting
- Deprecated
UIRequiresFullScreen, automatic adoptions, customizations to remove, manual adoptions - Fixes for common symptoms, including
.toolbarBackgroundignored onTabView
Key Pattern
Liquid Glass Navigation
swift
NavigationStack {
ContentView()
.navigationTitle("Home")
.toolbar { // On the view inside the stack, not on NavigationStack, so it morphs on push
ToolbarItem(placement: .automatic) {
Button("Add", systemImage: "plus") { }
}
}
.searchable(text: $searchText)
}@Animatable Macro
swift
@Animatable
struct ProgressRing: View {
var progress: Double // Automatically animatable
var body: some View {
Circle()
.trim(from: 0, to: progress)
.stroke(lineWidth: 4)
}
}WebView
swift
struct ArticleReader: View {
@State private var page = WebPage()
let url: URL
var body: some View {
// WebPage is @Observable — read isLoading/estimatedProgress directly.
WebView(page)
.overlay(alignment: .top) {
if page.isLoading {
ProgressView(value: page.estimatedProgress)
}
}
.task { page.load(URLRequest(url: url)) }
}
}Documentation Scope
This page documents the 26-ref skill (in the axiom-swiftui suite), the API coverage your assistant uses when you need specific iOS 26 SwiftUI APIs or feature details. For Liquid Glass design principles and adoption patterns, see liquid-glass.
Related
- liquid-glass-ref – app-wide Liquid Glass adoption guide
- swiftui-search-ref – the foundational
.searchableAPIs that the iOS 26 search changes build on - swiftui-animation-ref – the full animation API, including
AnimatableandVectorArithmetic - swiftui-performance – profiling with the SwiftUI instrument
- swiftui-debugging – diagnosing views that don't update
- typography-ref – the typography system behind
lineHeight
Resources
WWDC: 2025-256, 2025-278, 2025-287, 2025-310, 2025-323, 2025-325, 2025-341
Docs: /swiftui, /webkit, /charts/chart3d, /foundation/attributedstring