SwiftUI 26 Reference
API reference for the SwiftUI features introduced in iOS 26, and for the additions that build on them in the 27 releases (iOS 27, macOS 27, and the other OS 27 platforms, marked "27 cycle" below). It 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
- Concentric corners that follow their container or the device's screen
- Toolbar transitions and morphing during navigation
- Performance improvements in iOS 26
- The
@Animatablemacro for custom animation WebViewandWebPageintegrationWebPagenavigation rules, links that open in a new tab, and local HTML filesTextEditorwithAttributedStringChart3Dfor 3D data visualization- Spatial layout and scene bridging
- Tappable links, phone numbers, and addresses in text (27 cycle)
- A hook for observing
WebViewform submissions (27 cycle) - 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?" - "Why do links that open in a new tab do nothing in my SwiftUI
WebView?" - "How do I show a downloaded HTML folder with its CSS and images in a
WebPage?" - "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)- Search tab with
Tab(role: .search), 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(27 cycle)- 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 (27 Cycle)
.dataDetection(_:options:)– makes links, email addresses, phone numbers, postal addresses, dates and events, money amounts, measurements, flight and shipment-tracking numbers, and payment IDs in a view's text tappable (iOS, watchOS, and visionOS 27, and macOS 27.3 when built with the Xcode 27.3 SDK; not Mac Catalyst or tvOS)DataDetector.MatchTypeoptions from the DataDetection framework, 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 new SwiftUI instrument (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 state, back-forward list- Configuration at creation –
WebPage.Configuration, a separate website data store per user, and injected scripts kept apart from the page's own JavaScript (WKContentWorld) - Navigation rules –
WebPage.NavigationDeciding,decidePolicy(for:preferences:), andNavigationAction.targetfor links that open in a new tab - A misnamed navigation-rule method that compiles but never runs
WebPageversusWKWebView–WKWebViewnames and plausible inventions that don't exist onWebPage, and the real APIs to use instead- Local HTML – serving a downloaded folder (HTML plus its
css/andimages/) through aURLSchemeHandler(reply(for:)), sinceWebPagehas noloadFileURL - JavaScript execution –
callJavaScript(_:arguments:in:contentWorld:) - Sign-out cleanup for per-user website data stores
- Scroll control –
webViewScrollPosition(_:),webViewOnScrollGeometryChange(for:of:action:),webViewScrollInputBehavior(_:for:)(declared on iOS and macOS but callable only on visionOS, because iOS and macOS have noScrollInputKindvalue to pass) - Appearance and gestures –
webViewContentBackground(_:),webViewBackForwardNavigationGestures(_:),webViewMagnificationGestures(_:),webViewLinkPreviews(_:),webViewElementFullscreenBehavior(_:),webViewTextSelection(_:), and the macOS-onlywebViewContextMenu(menu:) WebViewinsideNavigationStack– safe-area and toolbar interaction, and why.ignoresSafeArea()is wrong there- Form-submission hook (27 cycle; iOS, macOS, and visionOS) –
WebPage.FormInfo,willSubmit(formInfo:),NavigationPreferences.alternateRequest/overrideReferrer/isGlobalPrivacyControlEnabled/allowsJSHandleCreationInPageWorld - No
WebVieworWebPageon watchOS or 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:containerNamespace:),dragContainer(for:in:),dragContainerSelection(_:containerNamespace:)(iOS and visionOS 27, macOS 26)DragConfiguration(allowDeleteis macOS-only),onDragSessionUpdated, and the macOS-onlydragPreviewsFormation(_:)
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(iPadOS 26), automatic adoptions, customizations to remove, manual adoptions - Fixes for common symptoms, including
.toolbarBackgroundignored onTabView
Key Patterns
Liquid Glass Navigation
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
@Animatable
struct ProgressRing: View {
var progress: Double // Automatically animatable
var body: some View {
Circle()
.trim(from: 0, to: progress)
.stroke(lineWidth: 4)
}
}WebView
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 { if page.url == nil { page.load(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, their 27-cycle additions, 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 - toolbars – toolbar placements, overflow, and item priority beyond the iOS 26 additions here
- iphone-duo – how concentric corners fit both of iPhone Duo's displays without per-device radii
Resources
WWDC: 2025-256, 2025-278, 2025-287, 2025-310, 2025-323, 2025-325, 2025-341
Docs: /swiftui, /webkit, /charts/chart3d, /foundation/attributedstring