axiom-swiftui-26-ref by charleswiltgen/axiom
npx skills add https://github.com/charleswiltgen/axiom --skill axiom-swiftui-26-refiOS 26、iPadOS 26、macOS Tahoe、watchOS 26 和 visionOS 26 中 SwiftUI 新特性的综合指南。从 Liquid Glass 设计系统到富文本编辑,这些增强功能使 SwiftUI 在所有 Apple 平台上变得更加强大。
核心原则 从底层的性能改进一直到用户界面中的按钮,整个系统都有一些重大改进。
enabledBounds 约束滑块选择范围如需全面了解,请参阅 axiom-liquid-glass(设计原则、变体、审查压力)和 axiom-liquid-glass-ref(应用范围采用指南)。本节仅涵盖 WWDC 256 特定的 API。
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
使用 iOS 26 SDK 重新编译 —— 导航容器、标签栏、工具栏、开关、分段选择器和滑块会自动采用新设计。带边框的按钮默认为胶囊形状。工作表获得 Liquid Glass 背景(移除任何 presentationBackground 自定义设置)。
.toolbar {
ToolbarItem(placement: .bottomBar) { Button("Archive", systemImage: "archivebox") { } }
ToolbarSpacer(.flexible, placement: .bottomBar) // 将项目推开
ToolbarItem(placement: .bottomBar) { Button("Compose", systemImage: "square.and.pencil") { } }
}
// .fixed 在视觉上分隔组;.flexible 推开(类似于 HStack 中的 Spacer)
ToolbarItemGroup 中的项目共享一个单一的玻璃背景“药丸”。ToolbarItemPlacement 控制视觉外观:confirmationAction → glassProminent 样式,cancellationAction → 标准玻璃样式。使用 .sharedBackgroundVisibility(.hidden) 将项目(例如头像)排除在组背景之外。
将 .toolbar {} 附加到 NavigationStack 内部的各个视图(而不是 NavigationStack 本身)。iOS 26 在推送/弹出期间在每视图工具栏之间变形。对于应保持稳定(无弹跳)的项目,在屏幕间使用带有匹配 ToolbarItem(id:) 的 toolbar(id:):
// 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" 不存在(动画消失),"compose" 保持稳定
.toolbar(id: "main") {
ToolbarSpacer(.flexible, placement: .bottomBar)
ToolbarItem(id: "compose", placement: .bottomBar) { Button("New Message") { } }
}
#1 常见陷阱:NavigationStack 上的 Toolbar = 没有可以变形的内容。
在工具栏布局中重新定位系统提供的项目(如搜索):
DefaultToolbarItem(kind: .search, placement: .bottomBar)
// 替换系统默认放置的匹配类型项目
在折叠的 NavigationSplitView 侧边栏中使用,以指定在 iPhone 上哪个列显示搜索。为向后兼容性,用 if #available(iOS 26.0, *) 包装。
toolbar(id:) 支持用户自定义(重新排列、显示/隐藏)。只有 .secondaryAction 项目在 iPadOS 上支持自定义。对可选项目使用 showsByDefault: false。为 macOS 菜单项添加 ToolbarCommands()。
.navigationSubtitle("3 unread") —— 标题下方的辅助行.badge(3) —— 通知计数基础搜索 API:请参阅 axiom-swiftui-search-ref。本节仅涵盖 iOS 26 的改进。
NavigationSplitView {
List { }.searchable(text: $searchText)
}
// 在 iPhone 上底部对齐,在 iPad 上顶部尾对齐(自动)
// 使用 placement: .sidebar 以在 iPad 上恢复侧边栏内嵌搜索
searchToolbarBehavior(.minimize) —— 点击时展开的紧凑搜索Tab(role: .search) —— 专用搜索标签页;搜索字段替换标签栏。参见 swiftui-nav-ref 第 5.7 节Button("To Top", systemImage: "chevron.up") { scrollToTop() }
.padding()
.glassEffect() // 在 iOS 上为自定义控件添加 .interactive
GlassEffectContainer —— 当附近有多个玻璃元素时需要(玻璃不能采样玻璃)glassEffectID(_:in:) —— 使用命名空间在玻璃元素之间进行流畅的变形过渡.matchedTransitionSource + .navigationTransition(.zoom(...)) 使工作表从按钮变形.buttonBorderShape(.roundedRectangle) 覆盖).controlSize(.extraLarge) —— 新的超大按钮尺寸.controlSize(.small) —— 保留 iOS 26 之前的密度GlassButtonStyle(.clear/.glass/.tint) —— 玻璃按钮变体(iOS 26.1+).buttonSizing(.fit/.stretch/.flexible) —— 控制按钮布局行为Button(role: .close) / Button(role: .confirm) —— 系统样式的关闭/确认按钮.clipShape(.rect(cornerRadius: 12, style: .containerConcentric)) —— 角同心度iOS 26 添加了自定义刻度标记、约束选择范围、当前值标签和滑块可见性控制。
核心类型:SliderTick<V>, SliderTickContentForEach, SliderTickBuilder
// 带标签的静态刻度
Slider(value: $value, in: 0...10) {
Text("Rating")
} ticks: {
SliderTick(0) { Text("Min") }
SliderTick(5) { Text("Mid") }
SliderTick(10) { Text("Max") }
}
// 从集合生成的动态刻度
SliderTickContentForEach(stops, id: \.self) { value in
SliderTick(value) { Text("\(Int(value))°").font(.caption2) }
}
// 基于步长的刻度(为每个步长值调用)
Slider(value: $volume, in: 0...10, step: 2, label: { Text("Volume") }, tick: { value in
SliderTick(value) { Text("\(Int(value))") }
})
API 约束:SliderTickContentForEach 要求 Data.Element 与 SliderTick<V> 值类型匹配。对于自定义结构体,提取数值:chapters.map(\.time),然后通过 chapters.first(where: { $0.time == time }) 查找标签。
Slider(
value: $rating, in: 0...100,
neutralValue: 50, // 起始点 / 中心值
enabledBounds: 20...80, // 限制可选范围
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(.hidden) —— 为媒体进度指示器和极简 UI 隐藏滑块。选项:.automatic, .visible, .hidden。在 watchOS 上始终可见。
带有集成渐进模糊的粘性栏:
List { ForEach(1...20, id: \.self) { Text("\($0). Item") } }
.safeAreaBar(edge: .bottom) {
Text("Bottom Action Bar").padding(.vertical, 15)
}
.scrollEdgeEffectStyle(.soft, for: .bottom) // 或 .hard
工作方式类似于 safeAreaInset,但带有模糊效果。栏保持固定,而内容在其下方滚动。
@Environment(\.openURL) var openURL
// openURL(url, prefersInApp: true) — 在 SFSafariViewController 风格的应用内浏览器中打开
// 默认 Link 在 Safari 中打开;prefersInApp 使用户留在你的应用中
有关基础的 .searchable API,请参阅 axiom-swiftui-search-ref。iOS 26 新增:
.searchable(text: $searchText)
.searchToolbarBehavior(.minimize) // 紧凑按钮,点击时展开
还有:.searchPresentationToolbarBehavior(.avoidHidingContent) (iOS 17.1+) 在搜索期间保持标题可见。
针对 iOS 18+26 应用的向后兼容包装器:
extension View {
@ViewBuilder func minimizedSearch() -> some View {
if #available(iOS 26.0, *) {
self.searchToolbarBehavior(.minimize)
} else { self }
}
}
// 用法
.searchable(text: $searchText)
.minimizedSearch()
工具栏项目的可用性模式:
.toolbar {
if #available(iOS 26.0, *) {
DefaultToolbarItem(kind: .search, placement: .bottomBar)
ToolbarSpacer(.flexible, placement: .bottomBar)
}
ToolbarItem(placement: .bottomBar) {
NewNoteButton()
}
}
.searchable(text: $searchText)
按钮角色、GlassButtonStyle、buttonSizing —— 参见上文的 Liquid Glass 设计系统部分。
设置文本行之间的基线到基线距离。比测量行底到下一行顶部的 .lineSpacing() 更直观。
Text("Lorem ipsum...")
.lineHeight(.loose) // 增加间距以用于开放式布局
.lineHeight(.tight) // 减少间距以用于紧凑布局
.lineHeight(.normal) // 基于点大小倍数的恒定高度
.lineHeight(.variable) // 使用字体度量计算高度
// 与字体大小成比例缩放
Text("Scales with text size")
.lineHeight(.multiple(factor: 2))
// 相对于点大小,有固定增量
Text("Point-size relative")
.lineHeight(.leading(increase: 30))
// 绝对固定值 — 不随动态类型缩放
Text("Fixed height")
.lineHeight(.exact(points: 30))
var s = AttributedString("Paragraph\nwith multiple\nlines.")
s.lineHeight = .exact(points: 32)
s.lineHeight = .multiple(factor: 2.5)
s.lineHeight = .loose
| API | 测量方式 | 可用性 |
|---|---|---|
.lineHeight() | 基线到基线 | iOS 26+ |
.lineSpacing() | 行底到下一行顶 | iOS 13+ |
.font(.body.leading(.tight)) | 字体级 leading 预设 | iOS 14+ |
交叉参考 axiom-typography-ref —— 包括动态类型、字距调整和国际化在内的完整排版系统
.commands {
TextEditingCommands() // 与 macOS 菜单栏相同的 API
CommandGroup(after: .newItem) {
Button("Add Note") {
addNote()
}
.keyboardShortcut("n", modifiers: [.command, .shift])
}
}
// 当用户下拉时在 iPad 上创建菜单栏
// 需要迁移:
// 在 iPadOS 26 中移除已弃用的属性列表键:
// UIRequiresFullscreen(整个键已弃用,所有值)
// 对于分屏导航,系统根据调整大小时可用空间自动显示/隐藏列
NavigationSplitView {
Sidebar()
} detail: {
Detail()
}
// 自动适应调整大小
参考 "Elevate the design of your iPad app" (WWDC 2025)
.windowResizeAnchor(.topLeading) // 定制动画起始位置
// SwiftUI 现在同步内容视图大小变化和窗口调整大小之间的动画
// 非常适合在切换标签页时保持连续性
List(trips) { trip in // 100k+ 项目
TripRow(trip: trip)
}
// 在 macOS 上加载速度快 6 倍,更新速度快 16 倍(iOS 26+)
SwiftUI 改进了 iOS 和 macOS 上用户界面更新的调度。这提高了响应能力,并让 SwiftUI 可以做更多工作来为即将到来的帧做准备。总而言之,它降低了你的应用在高帧率下快速滚动时掉帧的可能性。
ScrollView(.horizontal) {
LazyHStack {
ForEach(photoSets) { photoSet in
ScrollView(.vertical) {
LazyVStack {
ForEach(photoSet.photos) { photo in
PhotoView(photo: photo)
}
}
}
}
}
}
// 嵌套的 ScrollView 现在能正确延迟加载惰性堆栈
// 非常适合构建照片轮播
可用通道:
参考 "Optimize SwiftUI performance with instruments" (WWDC 2025)
交叉参考 SwiftUI Performance —— 掌握 SwiftUI 检测器
@Observable
class TripStore {
var trips: [Trip] = []
func loadTrips() async {
trips = await TripService.fetchTrips()
// Swift 6 在编译时验证数据竞争安全性
}
}
优势 在并发代码影响你的应用之前发现错误
交叉参考 Swift Concurrency —— Swift 6 严格并发模式
通过自动合成 animatableData 属性来简化自定义动画。
struct HikingRouteShape: Shape {
var startPoint: CGPoint
var endPoint: CGPoint
var elevation: Double
var drawingDirection: Bool // 不希望对此进行动画处理
// 繁琐的手动 animatableData 声明
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
}
}
}
@Animatable
struct HikingRouteShape: Shape {
var startPoint: CGPoint
var endPoint: CGPoint
var elevation: Double
@AnimatableIgnored
var drawingDirection: Bool // 从动画中排除
// animatableData 自动合成!
}
animatableData 属性@AnimatableIgnored 排除属性交叉参考 SwiftUI Animation (swiftui-animation-ref skill) —— 涵盖 VectorArithmetic、Animatable 协议、@Animatable 宏、动画类型、Transaction 系统和性能优化的综合动画指南
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 {
// 根据一天中的时间在 3D 空间中定位太阳
Alignment3D(
horizontal: .center,
vertical: .top,
depth: .back
)
}
}
Model3D(named: "WaterBottle")
.manipulable() // 用户可以拾取和移动对象
@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)
}
}
场景桥接允许你的 UIKit 和 AppKit 生命周期应用与 SwiftUI 场景互操作。应用可以使用它来打开仅限 SwiftUI 的场景类型,或直接从 UIKit 或 AppKit 代码使用 SwiftUI 独有的功能。
MenuBarExtra (macOS)ImmersiveSpace (visionOS)RemoteImmersiveSpace (macOS → Vision Pro)AssistiveAccess (iOS 26)可与场景修饰符配合使用,例如:
.windowStyle().immersiveEnvironmentBehavior()// 在你的 macOS 应用中
@main
struct MyMacApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
RemoteImmersiveSpace(id: "stereoView") {
// 在 Apple Vision Pro 上渲染立体内容
// 使用 CompositorServices
}
}
}
参考 "What's new in Metal rendering for immersive apps" (WWDC 2025)
@main
struct MyApp: App {
var body: some Scene {
WindowGroup {
ContentView()
}
AssistiveAccessScene {
SimplifiedUI() // 当 iPhone 处于 AssistiveAccess 模式时显示的 UI
}
}
}
参考 "Customize your app for Assistive Access" (WWDC 2025)
// 在 AppKit 工作表中显示 SwiftUI 视图
let hostingController = NSHostingController(rootView: SwiftUISettingsView())
presentAsSheet(hostingController)
// 非常适合逐步采用 SwiftUI
// 将 AppKit 手势桥接到 SwiftUI
struct AppKitPanGesture: NSGestureRecognizerRepresentable {
func makeNSGestureRecognizer(context: Context) -> NSPanGestureRecognizer {
NSPanGestureRecognizer()
}
func updateNSGestureRecognizer(_ recognizer: NSPanGestureRecognizer, context: Context) {
// 更新配置
}
}
NSHostingView 现在可以直接在 Interface Builder 中使用,以便逐步采用 SwiftUI。
@Observable
class RealityEntity {
var position: SIMD3<Float>
var rotation: simd_quatf
}
struct MyView: View {
@State private var entity = RealityEntity()
var body: some View {
// SwiftUI 视图自动观察变化
Text("Position: \(entity.position.x)")
}
}
直接从 RealityKit 实体呈现 SwiftUI 弹窗、警告和工作表。
// 从 RealityKit 实体呈现 SwiftUI 弹窗
let popover = Entity()
mapEntity.addChild(popover)
popover.components[PresentationComponent.self] = PresentationComponent(
isPresented: $popoverPresented,
configuration: .popover(arrowEdge: .bottom),
content: DetailsView()
)
ViewAttachmentComponent —— 将 SwiftUI 视图添加到实体GestureComponent —— 实体触摸和手势响应参考 "Better Together: SwiftUI & RealityKit" (WWDC 2025)
WebKit 现在提供了完整的 SwiftUI API 来嵌入网页内容,无需降级到 UIKit。
import WebKit
struct ArticleView: View {
let articleURL: URL
var body: some View {
WebView(url: articleURL)
}
}
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)
}
}
}
}
goBack(), goForward())title, url, canGoBack, canGoForward)tvOS:WebView 和 WebPage 在 tvOS 上不可用。tvOS 根本没有 WKWebView。对于 tvOS 上的网页内容解析,请使用 JavaScriptCore。有关替代方案,请参阅 axiom-tvos。
参考 "Meet WebKit for SwiftUI" (WWDC 2025)
SwiftUI 对富文本编辑的新支持非常适合像照片评论这样的体验。TextView 现在支持 AttributedString!
注意 WWDC 文稿使用 "TextView" 作为编辑语言。实际的 SwiftUI API 是 TextEditor,它现在支持用于富文本编辑的 AttributedString 绑定。
TextField("Label", text: $text, axis: .vertical) 而不是 TextEditor —— 支持占位符文本、一致的样式和自动垂直扩展(iOS 16+)AttributedString 绑定的 TextEditor(iOS 26+)—— TextField 不支持 AttributedStringstruct CommentView: View {
@State private var comment = AttributedString("Enter your comment")
var body: some View {
TextEditor(text: $comment)
// 包含内置文本格式化控件
// 用户可以应用粗体、斜体、下划线等
}
}
AttributedString 可保留格式参考 "Cook up a rich text experience in SwiftUI with AttributedString" (WWDC 2025)
交叉参考 App Intents Integration (app-intents-ref skill) —— 用于 Apple Intelligence Use Model 操作的 AttributedString
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)
}
}
}
关键 API:
.draggable(containerItemID:containerNamespace:) 将每个项目标记为拖动容器的一部分(命名空间默认为 nil).dragContainer(for:selection:) 在发生放置时惰性地提供类型化项目.dragConfiguration(DragConfiguration(allowMove: false, allowDelete: true))
.onDragSessionUpdated { session in
let ids = session.draggedItemIDs(for: Photo.ID.self)
if session.phase == .ended(.delete) {
trash(ids)
deletePhotos(ids)
}
}
.dragPreviewsFormation(.stack) // 项目整齐地堆叠在一起
// 其他排列方式:
// - .default
// - .grid
// - .stack
在同一滚动视图上组合所有修饰符(.dragContainer, .dragConfiguration, .dragPreviewsFormation, .onDragSessionUpdated)以获得完整的多项目拖动体验。
Swift Charts 通过 Chart3D 支持三维绘图。关键组件:Chart3D(容器)、SurfacePlot(连续曲面)、Chart3DPose(相机控制)、Chart3DSurfaceStyle(曲面外观)。
import Charts
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)
Chart3D 也接受数据集合:
Chart3D(dataPoints) { point in
// 每个数据点的 3D 标记
}
从数学函数映射 (x, y) 到 z 值来渲染连续曲面。
SurfacePlot(x: "X Axis", y: "Y Axis", z: "Z Axis") { x, y in
sin(sqrt(x * x + y * y))
}
SurfacePlot(x: "X", y: "Y", z: "Z") { x, y in sin(x) * cos(y) }
.foregroundStyle(.blue) // 纯色
.roughness(0.3) // 0 = 平滑,1 = 粗糙
// 基于高度的着色(颜色映射到 z 值)
.foregroundStyle(Chart3DSurfaceStyle.heightBased(yRange: -1.0...1.0))
// 映射到高度的自定义渐变
.foregroundStyle(Chart3DSurfaceStyle.heightBased(
Gradient(colors: [.blue, .green, .yellow, .red]),
yRange: -1.0...1.0
))
可用的曲面样式:.heightBased(按 z 值着色)、.normalBased(按曲面法线方向着色)。
Chart3D {
SurfacePlot(x: "X", y: "Y", z: "Z") { x, y in sin(x) * cos(y) }
SurfacePlot(x: "X", y: "Y", z: "Z") { x, y in cos(x) * sin(y) + 2 }
}
控制视角。作为值传递用于静态定位,或绑定用于交互式旋转。
@State private var chartPose: Chart3DPose = .default
Chart3D { /* ... */ }
.chart3DPose(chartPose) // 静态 — 只读
.chart3DPose($chartPose) // 绑定 — 启用拖拽旋转
预定义姿势:.default, .front, .back, .top, .bottom, .left, .right
具有特定角度的自定义姿势:
Chart3DPose(azimuth: .degrees(45), inclination: .degrees(30))
在姿势之间进行动画处理:
Button("Top View") { withAnimation { chartPose = .top } }
控制 3D 深度如何投影到 2D。
Chart3D { /* ... */ }
.chart3DCameraProjection(.perspective) // 物体随距离缩小
.chart3DCameraProjection(.orthographic) // 物体无论深度如何都保持大小
.chart3DCameraProjection(.automatic) // 系统决定
所有现有的图表轴修饰符都有对应的 z 轴版本:
.chartZScale(domain:) —— 设置 z 轴范围.chartZAxis() —— 配置 z 轴标签和网格线参考 "Bring Swift Charts to the third dimension" (WWDC 2025)
struct FavoriteLocationControl: ControlWidget {
var body: some ControlWidgetConfiguration {
StaticControlConfiguration(kind: "FavoriteLocation") {
ControlWidgetButton(action: MarkFavoriteIntent()) {
Label("Mark Favorite", systemImage: "star")
}
}
}
}
// 从表盘或快捷指令访问
控件现在出现在 Mac 的控制中心。
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() // 靠近时显示完整细节
case .simplified:
CountdownView() // 远离时显示简化版本
default:
CountdownView()
}
}
}
实时活动现在出现在 CarPlay 显示屏上,以便在驾驶时提供可一目了然的信息。
参考 "What's new in widgets" (WWDC 2025)
<key>UIRequiresFullscreen</key>
<!-- 整个属性列表键已弃用(所有值) -->
应用必须支持 iPad 上的可调整大小窗口。
✅ Liquid Glass 设计用于导航、标签栏、工具栏 ✅ iPhone 上的底部对齐搜索 ✅ 列表性能改进(加载快 6 倍,更新快 16 倍) ✅ 滚动性能改进 ✅ 系统控件(开关、选择器、滑块)新外观 ✅ 带边框按钮默认为胶囊形状 ✅ 更新的控件高度(在 macOS 上稍高) ✅ 工具栏中的单色图标渲染 ✅ 菜单:图标在引导边缘,iOS 和 macOS 保持一致 ✅ 工作表自动从对话框变形而出 ✅ 滚动边缘模糊/淡出在系统工具栏下方
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.
enabledBoundsFor 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.
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 {
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)
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.
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.
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.
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.
.navigationSubtitle("3 unread") — Secondary line below title.badge(3) on toolbar items — Notification countsFoundational 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 tapTab(role: .search) — Dedicated search tab; search field replaces tab bar. See swiftui-nav-ref Section 5.7Button("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.matchedTransitionSource + .navigationTransition(.zoom(...)) to morph sheets from buttons.buttonBorderShape(.roundedRectangle)).controlSize(.extraLarge) — New extra-large button size.controlSize(.small) on containers — Preserve pre-iOS 26 densityGlassButtonStyle(.clear/.glass/.tint) — Glass button variants (iOS 26.1+).buttonSizing(.fit/.stretch/.flexible) — Control button layout behaviorButton(role: .close) / Button(role: .confirm) — System-styled close/confirm.clipShape(.rect(cornerRadius: 12, style: .containerConcentric)) — Corner concentricityiOS 26 adds custom tick marks, constrained selection ranges, current value labels, and thumb visibility control.
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 }).
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(.hidden) — Hide thumb for media progress indicators and minimal UI. Options: .automatic, .visible, .hidden. Always visible on watchOS.
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.
@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
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.
Sets the baseline-to-baseline distance between text lines. More intuitive than .lineSpacing() which measures bottom-of-line to top-of-next-line.
Text("Lorem ipsum...")
.lineHeight(.loose) // Increased spacing for open layouts
.lineHeight(.tight) // Reduced spacing for compact layouts
.lineHeight(.normal) // Constant height based on point size multiple
.lineHeight(.variable) // Uses font metrics for height calculation
// Scale proportionally to font size
Text("Scales with text size")
.lineHeight(.multiple(factor: 2))
// Relative to point size with fixed increase
Text("Point-size relative")
.lineHeight(.leading(increase: 30))
// Absolute fixed value — does NOT scale with Dynamic Type
Text("Fixed height")
.lineHeight(.exact(points: 30))
var s = AttributedString("Paragraph\nwith multiple\nlines.")
s.lineHeight = .exact(points: 32)
s.lineHeight = .multiple(factor: 2.5)
s.lineHeight = .loose
| API | Measures | Available |
|---|---|---|
.lineHeight() | Baseline to baseline | iOS 26+ |
.lineSpacing() | Bottom of line to top of next | iOS 13+ |
.font(.body.leading(.tight)) | Font-level leading preset | iOS 14+ |
Cross-reference axiom-typography-ref — Full typography system including Dynamic Type, tracking, and internationalization
.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
// 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)
.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
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+)
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.
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
Available lanes:
Reference "Optimize SwiftUI performance with instruments" (WWDC 2025)
Cross-reference SwiftUI Performance — Master the SwiftUI Instrument
@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
Cross-reference Swift Concurrency — Swift 6 strict concurrency patterns
Simplifies custom animations by automatically synthesizing animatableData property.
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
}
}
}
@Animatable
struct HikingRouteShape: Shape {
var startPoint: CGPoint
var endPoint: CGPoint
var elevation: Double
@AnimatableIgnored
var drawingDirection: Bool // Excluded from animation
// animatableData automatically synthesized!
}
animatableData property@AnimatableIgnored for properties to excludeCross-reference SwiftUI Animation (swiftui-animation-ref skill) — Comprehensive animation guide covering VectorArithmetic, Animatable protocol, @Animatable macro, animation types, Transaction system, and performance optimization
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
)
}
}
Model3D(named: "WaterBottle")
.manipulable() // People can pick up and move the object
@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)
}
}
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.
MenuBarExtra (macOS)ImmersiveSpace (visionOS)RemoteImmersiveSpace (macOS → Vision Pro)AssistiveAccess (iOS 26)Works with scene modifiers like:
.windowStyle().immersiveEnvironmentBehavior()// 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
}
}
}
Reference "What's new in Metal rendering for immersive apps" (WWDC 2025)
@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)
// Show SwiftUI view in AppKit sheet
let hostingController = NSHostingController(rootView: SwiftUISettingsView())
presentAsSheet(hostingController)
// Great for incremental SwiftUI adoption
// Bridge AppKit gestures to SwiftUI
struct AppKitPanGesture: NSGestureRecognizerRepresentable {
func makeNSGestureRecognizer(context: Context) -> NSPanGestureRecognizer {
NSPanGestureRecognizer()
}
func updateNSGestureRecognizer(_ recognizer: NSPanGestureRecognizer, context: Context) {
// Update configuration
}
}
NSHostingView can now be used directly in Interface Builder for gradual SwiftUI adoption.
@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)")
}
}
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()
)
ViewAttachmentComponent — add SwiftUI views to entitiesGestureComponent — entity touch and gesture responsivenessReference "Better Together: SwiftUI & RealityKit" (WWDC 2025)
WebKit now provides full SwiftUI APIs for embedding web content, eliminating the need to drop down to UIKit.
import WebKit
struct ArticleView: View {
let articleURL: URL
var body: some View {
WebView(url: articleURL)
}
}
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)
}
}
}
}
goBack(), goForward())title, url, canGoBack, canGoForward)tvOS : WebView and WebPage are not available on tvOS. tvOS has no WKWebView at all. For web content parsing on tvOS, use JavaScriptCore. See axiom-tvos for alternatives.
Reference "Meet WebKit for SwiftUI" (WWDC 2025)
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.
TextField("Label", text: $text, axis: .vertical) over TextEditor — supports placeholder text, consistent styling, and automatic vertical expansion (iOS 16+)TextEditor with AttributedString binding (iOS 26+) — TextField does not support AttributedStringstruct 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.
}
}
AttributedString preserves formattingReference "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
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(DragConfiguration(allowMove: false, allowDelete: true))
.onDragSessionUpdated { session in
let ids = session.draggedItemIDs(for: Photo.ID.self)
if session.phase == .ended(.delete) {
trash(ids)
deletePhotos(ids)
}
}
.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.
Swift Charts supports three-dimensional plotting with Chart3D. Key components: Chart3D (container), SurfacePlot (continuous surfaces), Chart3DPose (camera control), Chart3DSurfaceStyle (surface appearance).
import Charts
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)
Chart3D also accepts data collections:
Chart3D(dataPoints) { point in
// 3D mark for each data point
}
Renders continuous surfaces from a mathematical function mapping (x, y) to z values.
SurfacePlot(x: "X Axis", y: "Y Axis", z: "Z Axis") { x, y in
sin(sqrt(x * x + y * y))
}
SurfacePlot(x: "X", y: "Y", z: "Z") { x, y in sin(x) * cos(y) }
.foregroundStyle(.blue) // Solid color
.roughness(0.3) // 0 = smooth, 1 = rough
// Height-based coloring (color maps to z-value)
.foregroundStyle(Chart3DSurfaceStyle.heightBased(yRange: -1.0...1.0))
// Custom gradient mapped to height
.foregroundStyle(Chart3DSurfaceStyle.heightBased(
Gradient(colors: [.blue, .green, .yellow, .red]),
yRange: -1.0...1.0
))
Available surface styles: .heightBased (color by z-value), .normalBased (color by surface normal direction).
Chart3D {
SurfacePlot(x: "X", y: "Y", z: "Z") { x, y in sin(x) * cos(y) }
SurfacePlot(x: "X", y: "Y", z: "Z") { x, y in cos(x) * sin(y) + 2 }
}
Controls the viewing angle. Pass as value for static positioning, or bind for interactive rotation.
@State private var chartPose: Chart3DPose = .default
Chart3D { /* ... */ }
.chart3DPose(chartPose) // Static — read-only
.chart3DPose($chartPose) // Binding — enables drag-to-rotate
Predefined poses: .default, .front, .back, .top, .bottom, .left, .right
Custom pose with specific angles:
Chart3DPose(azimuth: .degrees(45), inclination: .degrees(30))
Animate between poses:
Button("Top View") { withAnimation { chartPose = .top } }
Controls how 3D depth is projected to 2D.
Chart3D { /* ... */ }
.chart3DCameraProjection(.perspective) // Objects shrink with distance
.chart3DCameraProjection(.orthographic) // Objects maintain size regardless of depth
.chart3DCameraProjection(.automatic) // System decides
All existing chart axis modifiers have z-axis equivalents:
.chartZScale(domain:) — Set z-axis range.chartZAxis() — Configure z-axis labels and grid linesReference "Bring Swift Charts to the third dimension" (WWDC 2025)
struct FavoriteLocationControl: ControlWidget {
var body: some ControlWidgetConfiguration {
StaticControlConfiguration(kind: "FavoriteLocation") {
ControlWidgetButton(action: MarkFavoriteIntent()) {
Label("Mark Favorite", systemImage: "star")
}
}
}
}
// Access from watch face or Shortcuts
Controls now appear in Control Center on Mac.
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()
}
}
}
Live Activities now appear on CarPlay displays for glanceable information while driving.
Reference "What's new in widgets" (WWDC 2025)
<key>UIRequiresFullscreen</key>
<!-- Entire property list key is deprecated (all values) -->
Apps must support resizable windows on iPad.
✅ 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
⚠️ 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)
🔧 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 () 🔧 Window resize anchor () 🔧 @Animatable macro for custom shapes/modifiers 🔧 WebView for web content 🔧 TextEditor with AttributedString binding 🔧 Enhanced drag and drop with 🔧 Slider ticks (, ) 🔧 Slider thumb visibility () 🔧 Safe area bars with blur ( + ) 🔧 In-app URL opening () 🔧 Close and confirm button roles () 🔧 Glass button styles ( — iOS 26.1+) 🔧 Button sizing control () 🔧 Toolbar morphing transitions (per-view inside NavigationStack) 🔧 DefaultToolbarItem for system components in toolbars 🔧 Stable toolbar items ( with matched IDs across screens) 🔧 User-customizable toolbars ( with ) 🔧 Line height control ( — baseline-to-baseline distance) 🔧 Tab bar minimization () 🔧 Tab view bottom accessory ( — iOS 26.1+)
.toolbar {} to individual views (not NavigationStack); remove presentationBackground from sheets; use GlassEffectContainer for nearby glass elements.safeAreaPadding() for edge-to-edge (not .padding()). See axiom-swiftui-layout-ref for full guideAttributedString to TextEditor; constrain attributes for your UX| Symptom | Fix |
|---|---|
| Old design after updating to iOS 26 SDK | Clean build (Shift-Cmd-K), rebuild targeting iOS 26 SDK, check deployment target |
| Search remains at top on iPhone | Place .searchable on NavigationSplitView, not on List directly |
| @Animatable "does not conform" | All properties must be VectorArithmetic or marked @AnimatableIgnored |
| Rich text formatting lost in TextEditor | Bind AttributedString, not String |
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, /charts/chart3d, /charts/surfaceplot, /charts/chart3dpose, /charts/chart3dcameraprojection, /charts/chart3dsurfacestyle, /realitykit/presentationcomponent
Skills : axiom-swiftui-performance, axiom-liquid-glass, axiom-swift-concurrency, axiom-app-intents-ref, axiom-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+
Weekly Installs
187
Repository
GitHub Stars
610
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketFailSnykWarn
Installed on
opencode167
codex159
gemini-cli152
claude-code152
github-copilot144
cursor141
.commands.windowResizeAnchor().dragContainerSliderTickSliderTickContentForEach.sliderThumbVisibility().safeAreaBar().scrollEdgeEffectStyle()openURL(url, prefersInApp: true)Button(role: .close)GlassButtonStyle.buttonSizing().toolbar {}toolbar(id:)toolbar(id:)CustomizableToolbarContent.lineHeight().tabBarMinimizeBehavior(.onScrollDown).tabViewBottomAccessory(isEnabled:content:)Alignment3D.manipulable()| Drag delete not working | Enable .dragConfiguration(allowDelete: true) AND observe .onDragSessionUpdated |
| SliderTickContentForEach won't compile | Iterate over numeric values (chapters.map(\.time)), not custom structs — see Slider section |
| Toolbar not morphing during navigation | Move .toolbar {} from NavigationStack to each view inside it — see Liquid Glass section |