claudecode-omc 5.6.7 → 5.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (123) hide show
  1. package/.local/skills/THIRD_PARTY_LICENSES/AvdLee-SwiftUI-Agent-Skill.LICENSE +21 -0
  2. package/.local/skills/THIRD_PARTY_LICENSES/Dimillian-Skills.LICENSE +21 -0
  3. package/.local/skills/THIRD_PARTY_LICENSES/README.md +36 -0
  4. package/.local/skills/THIRD_PARTY_LICENSES/twostraws-swiftui-agent-skill.LICENSE +21 -0
  5. package/.local/skills/ios-debugger-agent/SKILL.md +51 -0
  6. package/.local/skills/ios-debugger-agent/agents/openai.yaml +4 -0
  7. package/.local/skills/swift-concurrency-expert/SKILL.md +105 -0
  8. package/.local/skills/swift-concurrency-expert/agents/openai.yaml +4 -0
  9. package/.local/skills/swift-concurrency-expert/references/approachable-concurrency.md +63 -0
  10. package/.local/skills/swift-concurrency-expert/references/swift-6-2-concurrency.md +272 -0
  11. package/.local/skills/swift-concurrency-expert/references/swiftui-concurrency-tour-wwdc.md +33 -0
  12. package/.local/skills/swiftui-expert-skill/SKILL.md +162 -0
  13. package/.local/skills/swiftui-expert-skill/references/accessibility-patterns.md +215 -0
  14. package/.local/skills/swiftui-expert-skill/references/animation-advanced.md +403 -0
  15. package/.local/skills/swiftui-expert-skill/references/animation-basics.md +284 -0
  16. package/.local/skills/swiftui-expert-skill/references/animation-transitions.md +326 -0
  17. package/.local/skills/swiftui-expert-skill/references/charts-accessibility.md +135 -0
  18. package/.local/skills/swiftui-expert-skill/references/charts.md +602 -0
  19. package/.local/skills/swiftui-expert-skill/references/focus-patterns.md +299 -0
  20. package/.local/skills/swiftui-expert-skill/references/image-optimization.md +203 -0
  21. package/.local/skills/swiftui-expert-skill/references/latest-apis.md +488 -0
  22. package/.local/skills/swiftui-expert-skill/references/layout-best-practices.md +266 -0
  23. package/.local/skills/swiftui-expert-skill/references/liquid-glass.md +423 -0
  24. package/.local/skills/swiftui-expert-skill/references/list-patterns.md +446 -0
  25. package/.local/skills/swiftui-expert-skill/references/macos-scenes.md +318 -0
  26. package/.local/skills/swiftui-expert-skill/references/macos-views.md +357 -0
  27. package/.local/skills/swiftui-expert-skill/references/macos-window-styling.md +303 -0
  28. package/.local/skills/swiftui-expert-skill/references/performance-patterns.md +403 -0
  29. package/.local/skills/swiftui-expert-skill/references/scroll-patterns.md +293 -0
  30. package/.local/skills/swiftui-expert-skill/references/sheet-navigation-patterns.md +363 -0
  31. package/.local/skills/swiftui-expert-skill/references/state-management.md +388 -0
  32. package/.local/skills/swiftui-expert-skill/references/text-patterns.md +32 -0
  33. package/.local/skills/swiftui-expert-skill/references/trace-analysis.md +295 -0
  34. package/.local/skills/swiftui-expert-skill/references/trace-recording.md +134 -0
  35. package/.local/skills/swiftui-expert-skill/references/view-structure.md +780 -0
  36. package/.local/skills/swiftui-expert-skill/scripts/__pycache__/analyze_trace.cpython-313.pyc +0 -0
  37. package/.local/skills/swiftui-expert-skill/scripts/__pycache__/record_trace.cpython-313.pyc +0 -0
  38. package/.local/skills/swiftui-expert-skill/scripts/analyze_trace.py +301 -0
  39. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/__init__.py +1 -0
  40. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/__pycache__/__init__.cpython-313.pyc +0 -0
  41. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/__pycache__/causes.cpython-313.pyc +0 -0
  42. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/__pycache__/correlate.cpython-313.pyc +0 -0
  43. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/__pycache__/events.cpython-313.pyc +0 -0
  44. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/__pycache__/hangs.cpython-313.pyc +0 -0
  45. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/__pycache__/hitches.cpython-313.pyc +0 -0
  46. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/__pycache__/summary.cpython-313.pyc +0 -0
  47. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/__pycache__/swiftui.cpython-313.pyc +0 -0
  48. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/__pycache__/time_profiler.cpython-313.pyc +0 -0
  49. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/__pycache__/xctrace.cpython-313.pyc +0 -0
  50. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/__pycache__/xml_utils.cpython-313.pyc +0 -0
  51. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/causes.py +187 -0
  52. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/correlate.py +179 -0
  53. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/events.py +291 -0
  54. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/hangs.py +108 -0
  55. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/hitches.py +145 -0
  56. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/summary.py +243 -0
  57. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/swiftui.py +195 -0
  58. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/time_profiler.py +135 -0
  59. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/xctrace.py +117 -0
  60. package/.local/skills/swiftui-expert-skill/scripts/instruments_parser/xml_utils.py +224 -0
  61. package/.local/skills/swiftui-expert-skill/scripts/record_trace.py +252 -0
  62. package/.local/skills/swiftui-liquid-glass/SKILL.md +90 -0
  63. package/.local/skills/swiftui-liquid-glass/agents/openai.yaml +4 -0
  64. package/.local/skills/swiftui-liquid-glass/references/liquid-glass.md +280 -0
  65. package/.local/skills/swiftui-performance-audit/SKILL.md +106 -0
  66. package/.local/skills/swiftui-performance-audit/agents/openai.yaml +4 -0
  67. package/.local/skills/swiftui-performance-audit/references/code-smells.md +150 -0
  68. package/.local/skills/swiftui-performance-audit/references/demystify-swiftui-performance-wwdc23.md +46 -0
  69. package/.local/skills/swiftui-performance-audit/references/optimizing-swiftui-performance-instruments.md +29 -0
  70. package/.local/skills/swiftui-performance-audit/references/profiling-intake.md +44 -0
  71. package/.local/skills/swiftui-performance-audit/references/report-template.md +47 -0
  72. package/.local/skills/swiftui-performance-audit/references/understanding-hangs-in-your-app.md +33 -0
  73. package/.local/skills/swiftui-performance-audit/references/understanding-improving-swiftui-performance.md +52 -0
  74. package/.local/skills/swiftui-pro/SKILL.md +108 -0
  75. package/.local/skills/swiftui-pro/agents/openai.yaml +10 -0
  76. package/.local/skills/swiftui-pro/assets/swiftui-pro-icon.png +0 -0
  77. package/.local/skills/swiftui-pro/assets/swiftui-pro-icon.svg +29 -0
  78. package/.local/skills/swiftui-pro/references/accessibility.md +13 -0
  79. package/.local/skills/swiftui-pro/references/api.md +39 -0
  80. package/.local/skills/swiftui-pro/references/data.md +43 -0
  81. package/.local/skills/swiftui-pro/references/design.md +32 -0
  82. package/.local/skills/swiftui-pro/references/hygiene.md +9 -0
  83. package/.local/skills/swiftui-pro/references/navigation.md +14 -0
  84. package/.local/skills/swiftui-pro/references/performance.md +46 -0
  85. package/.local/skills/swiftui-pro/references/swift.md +56 -0
  86. package/.local/skills/swiftui-pro/references/views.md +36 -0
  87. package/.local/skills/swiftui-ui-patterns/SKILL.md +95 -0
  88. package/.local/skills/swiftui-ui-patterns/agents/openai.yaml +4 -0
  89. package/.local/skills/swiftui-ui-patterns/references/app-wiring.md +201 -0
  90. package/.local/skills/swiftui-ui-patterns/references/async-state.md +96 -0
  91. package/.local/skills/swiftui-ui-patterns/references/components-index.md +50 -0
  92. package/.local/skills/swiftui-ui-patterns/references/controls.md +57 -0
  93. package/.local/skills/swiftui-ui-patterns/references/deeplinks.md +66 -0
  94. package/.local/skills/swiftui-ui-patterns/references/focus.md +90 -0
  95. package/.local/skills/swiftui-ui-patterns/references/form.md +97 -0
  96. package/.local/skills/swiftui-ui-patterns/references/grids.md +71 -0
  97. package/.local/skills/swiftui-ui-patterns/references/haptics.md +71 -0
  98. package/.local/skills/swiftui-ui-patterns/references/input-toolbar.md +51 -0
  99. package/.local/skills/swiftui-ui-patterns/references/lightweight-clients.md +93 -0
  100. package/.local/skills/swiftui-ui-patterns/references/list.md +86 -0
  101. package/.local/skills/swiftui-ui-patterns/references/loading-placeholders.md +38 -0
  102. package/.local/skills/swiftui-ui-patterns/references/macos-settings.md +71 -0
  103. package/.local/skills/swiftui-ui-patterns/references/matched-transitions.md +59 -0
  104. package/.local/skills/swiftui-ui-patterns/references/media.md +73 -0
  105. package/.local/skills/swiftui-ui-patterns/references/menu-bar.md +101 -0
  106. package/.local/skills/swiftui-ui-patterns/references/navigationstack.md +159 -0
  107. package/.local/skills/swiftui-ui-patterns/references/overlay.md +45 -0
  108. package/.local/skills/swiftui-ui-patterns/references/performance.md +62 -0
  109. package/.local/skills/swiftui-ui-patterns/references/previews.md +48 -0
  110. package/.local/skills/swiftui-ui-patterns/references/scroll-reveal.md +133 -0
  111. package/.local/skills/swiftui-ui-patterns/references/scrollview.md +87 -0
  112. package/.local/skills/swiftui-ui-patterns/references/searchable.md +71 -0
  113. package/.local/skills/swiftui-ui-patterns/references/sheets.md +155 -0
  114. package/.local/skills/swiftui-ui-patterns/references/split-views.md +72 -0
  115. package/.local/skills/swiftui-ui-patterns/references/tabview.md +114 -0
  116. package/.local/skills/swiftui-ui-patterns/references/theming.md +71 -0
  117. package/.local/skills/swiftui-ui-patterns/references/title-menus.md +93 -0
  118. package/.local/skills/swiftui-ui-patterns/references/top-bar.md +49 -0
  119. package/.local/skills/swiftui-view-refactor/SKILL.md +202 -0
  120. package/.local/skills/swiftui-view-refactor/agents/openai.yaml +4 -0
  121. package/.local/skills/swiftui-view-refactor/references/mv-patterns.md +161 -0
  122. package/bundled/manifest.json +1 -1
  123. package/package.json +1 -1
@@ -0,0 +1,266 @@
1
+ # SwiftUI Layout Best Practices Reference
2
+
3
+ ## Table of Contents
4
+
5
+ - [Relative Layout Over Constants](#relative-layout-over-constants)
6
+ - [Context-Agnostic Views](#context-agnostic-views)
7
+ - [Own Your Container](#own-your-container)
8
+ - [Layout Performance](#layout-performance)
9
+ - [View Logic and Testability](#view-logic-and-testability)
10
+ - [Full-Width Views](#full-width-views)
11
+ - [Action Handlers](#action-handlers)
12
+ - [Summary Checklist](#summary-checklist)
13
+
14
+ ## Relative Layout Over Constants
15
+
16
+ **Use dynamic layout calculations instead of hard-coded values.**
17
+
18
+ ```swift
19
+ // Good - relative to actual layout
20
+ GeometryReader { geometry in
21
+ VStack {
22
+ HeaderView()
23
+ .frame(height: geometry.size.height * 0.2)
24
+ ContentView()
25
+ }
26
+ }
27
+
28
+ // Avoid - magic numbers that don't adapt
29
+ VStack {
30
+ HeaderView()
31
+ .frame(height: 150) // Doesn't adapt to different screens
32
+ ContentView()
33
+ }
34
+ ```
35
+
36
+ **Why**: Hard-coded values don't account for different screen sizes, orientations, or dynamic content (like status bars during phone calls).
37
+
38
+ ## Context-Agnostic Views
39
+
40
+ **Views should work in any context.** Never assume presentation style or screen size.
41
+
42
+ ```swift
43
+ // Good - adapts to given space
44
+ struct ProfileCard: View {
45
+ let user: User
46
+
47
+ var body: some View {
48
+ VStack {
49
+ Image(user.avatar)
50
+ .resizable()
51
+ .aspectRatio(contentMode: .fit)
52
+ Text(user.name)
53
+ Spacer()
54
+ }
55
+ .padding()
56
+ }
57
+ }
58
+
59
+ // Avoid - assumes full screen
60
+ struct ProfileCard: View {
61
+ let user: User
62
+
63
+ var body: some View {
64
+ VStack {
65
+ Image(user.avatar)
66
+ .frame(width: UIScreen.main.bounds.width) // Wrong!
67
+ Text(user.name)
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ **Why**: Views should work as full screens, modals, sheets, popovers, or embedded content.
74
+
75
+ ## Own Your Container
76
+
77
+ **Custom views should own static containers but not lazy/repeatable ones.**
78
+
79
+ ```swift
80
+ // Good - owns static container
81
+ struct HeaderView: View {
82
+ var body: some View {
83
+ HStack {
84
+ Image(systemName: "star")
85
+ Text("Title")
86
+ Spacer()
87
+ }
88
+ }
89
+ }
90
+
91
+ // Avoid - missing container
92
+ struct HeaderView: View {
93
+ var body: some View {
94
+ Image(systemName: "star")
95
+ Text("Title")
96
+ // Caller must wrap in HStack
97
+ }
98
+ }
99
+
100
+ // Good - caller owns lazy container
101
+ struct FeedView: View {
102
+ let items: [Item]
103
+
104
+ var body: some View {
105
+ LazyVStack {
106
+ ForEach(items) { item in
107
+ ItemRow(item: item)
108
+ }
109
+ }
110
+ }
111
+ }
112
+ ```
113
+
114
+ ## Layout Performance
115
+
116
+ ### Avoid Layout Thrash
117
+
118
+ **Minimize deep view hierarchies and excessive layout dependencies.**
119
+
120
+ ```swift
121
+ // Bad - deep nesting, excessive layout passes
122
+ VStack {
123
+ HStack {
124
+ VStack {
125
+ HStack {
126
+ VStack {
127
+ Text("Deep")
128
+ }
129
+ }
130
+ }
131
+ }
132
+ }
133
+
134
+ // Good - flatter hierarchy
135
+ VStack {
136
+ Text("Shallow")
137
+ Text("Structure")
138
+ }
139
+ ```
140
+
141
+ **Avoid excessive `GeometryReader` and preference chains:**
142
+
143
+ ```swift
144
+ // Bad - multiple geometry readers cause layout thrash
145
+ GeometryReader { outerGeometry in
146
+ VStack {
147
+ GeometryReader { innerGeometry in
148
+ // Layout recalculates multiple times
149
+ }
150
+ }
151
+ }
152
+
153
+ // Good - single geometry reader or use alternatives (iOS 17+)
154
+ containerRelativeFrame(.horizontal) { width, _ in
155
+ width * 0.8
156
+ }
157
+ ```
158
+
159
+ **Gate frequent geometry updates:**
160
+
161
+ ```swift
162
+ // Bad - updates on every pixel change
163
+ .onPreferenceChange(ViewSizeKey.self) { size in
164
+ currentSize = size
165
+ }
166
+
167
+ // Good - gate by threshold
168
+ .onPreferenceChange(ViewSizeKey.self) { size in
169
+ let difference = abs(size.width - currentSize.width)
170
+ if difference > 10 { // Only update if significant change
171
+ currentSize = size
172
+ }
173
+ }
174
+ ```
175
+
176
+ ## View Logic and Testability
177
+
178
+ ### Keep Business Logic in Services and Models
179
+
180
+ **Business logic belongs in services and models, not in views.** Views should stay simple and declarative — orchestrating UI state, not implementing business rules. This makes logic independently testable without requiring view instantiation.
181
+
182
+ > **iOS 17+**: Use `@Observable` with `@State`.
183
+
184
+ ```swift
185
+ @Observable
186
+ final class AuthService {
187
+ var email = ""
188
+ var password = ""
189
+ var isValid: Bool {
190
+ !email.isEmpty && password.count >= 8
191
+ }
192
+
193
+ func login() async throws {
194
+ // Business logic here — testable without the view
195
+ }
196
+ }
197
+
198
+ struct LoginView: View {
199
+ @State private var authService = AuthService()
200
+
201
+ var body: some View {
202
+ Form {
203
+ TextField("Email", text: $authService.email)
204
+ SecureField("Password", text: $authService.password)
205
+ Button("Login") {
206
+ Task {
207
+ try? await authService.login()
208
+ }
209
+ }
210
+ .disabled(!authService.isValid)
211
+ }
212
+ }
213
+ }
214
+ ```
215
+
216
+ For iOS 16 and earlier, use `ObservableObject` with `@StateObject` -- see `state-management.md` for the legacy pattern.
217
+
218
+ Avoid embedding business logic directly in view closures (e.g., validation checks inside a `Button` action). This makes logic untestable without view instantiation.
219
+
220
+ **Note**: This is about making business logic testable, not about enforcing a specific architecture. The key is that logic lives outside views where it can be tested independently.
221
+
222
+ ## Full-Width Views
223
+
224
+ **When a single view needs to fill the available width, use `.frame(maxWidth: .infinity, alignment:)` instead of wrapping it in a stack with a `Spacer`.**
225
+
226
+ ```swift
227
+ // Good - frame modifier
228
+ Text("Hello")
229
+ .frame(maxWidth: .infinity, alignment: .leading)
230
+
231
+ // Avoid - unnecessary stack and spacer
232
+ HStack {
233
+ Text("Hello")
234
+ Spacer()
235
+ }
236
+ ```
237
+
238
+ **Why**: `.frame(maxWidth:alignment:)` is a single modifier that clearly communicates intent. Wrapping in an `HStack` with a `Spacer` adds an extra container to the view hierarchy for no benefit.
239
+
240
+ ## Action Handlers
241
+
242
+ **Separate layout from logic.** View body should reference action methods, not contain inline logic.
243
+
244
+ ```swift
245
+ // Good - action references method
246
+ Button("Publish Project", action: publishService.handlePublish)
247
+
248
+ // Avoid - multi-line logic in closure
249
+ Button("Publish Project") {
250
+ isLoading = true
251
+ apiService.publish(project) { result in /* ... */ }
252
+ }
253
+ ```
254
+
255
+ ## Summary Checklist
256
+
257
+ - [ ] Use relative layout over hard-coded constants
258
+ - [ ] Views work in any context (don't assume screen size)
259
+ - [ ] Custom views own static containers
260
+ - [ ] Avoid deep view hierarchies (layout thrash)
261
+ - [ ] Gate frequent geometry updates by thresholds
262
+ - [ ] Business logic kept in services and models (not in views)
263
+ - [ ] Action handlers reference methods, not inline logic
264
+ - [ ] Use `.frame(maxWidth: .infinity, alignment:)` for full-width views (not `HStack` + `Spacer`)
265
+ - [ ] Avoid excessive `GeometryReader` usage
266
+ - [ ] Use `containerRelativeFrame()` when appropriate
@@ -0,0 +1,423 @@
1
+ # SwiftUI Liquid Glass Reference (iOS 26+)
2
+
3
+ ## Table of Contents
4
+
5
+ - [Overview](#overview)
6
+ - [Availability](#availability)
7
+ - [Core APIs](#core-apis)
8
+ - [GlassEffectContainer](#glasseffectcontainer)
9
+ - [Glass Button Styles](#glass-button-styles)
10
+ - [Morphing Transitions](#morphing-transitions)
11
+ - [Modifier Order](#modifier-order)
12
+ - [Complete Examples](#complete-examples)
13
+ - [Fallback Strategies](#fallback-strategies)
14
+ - [Design System Notes](#design-system-notes)
15
+ - [Best Practices](#best-practices)
16
+ - [Checklist](#checklist)
17
+
18
+ ## Overview
19
+
20
+ Liquid Glass is Apple's new design language introduced in iOS 26. It provides translucent, dynamic surfaces that respond to content and user interaction. This reference covers the native SwiftUI APIs for implementing Liquid Glass effects.
21
+
22
+ **Only adopt Liquid Glass when explicitly requested by the user.** Do not proactively convert existing UI to glass effects.
23
+
24
+ ## Availability
25
+
26
+ All Liquid Glass APIs require iOS 26 or later. Always provide fallbacks:
27
+
28
+ ```swift
29
+ if #available(iOS 26, *) {
30
+ // Liquid Glass implementation
31
+ } else {
32
+ // Fallback using materials
33
+ }
34
+ ```
35
+
36
+ ## Core APIs
37
+
38
+ ### glassEffect Modifier
39
+
40
+ The primary modifier for applying glass effects to views:
41
+
42
+ ```swift
43
+ .glassEffect(_ glass: Glass = .regular, in shape: some Shape = .rect, isEnabled: Bool = true)
44
+ ```
45
+
46
+ #### Basic Usage
47
+
48
+ ```swift
49
+ Text("Hello")
50
+ .padding()
51
+ .glassEffect() // Default regular style, rect shape
52
+ ```
53
+
54
+ #### With Shape
55
+
56
+ ```swift
57
+ Text("Rounded Glass")
58
+ .padding()
59
+ .glassEffect(in: .rect(cornerRadius: 16))
60
+
61
+ Image(systemName: "star")
62
+ .padding()
63
+ .glassEffect(in: .circle)
64
+
65
+ Text("Capsule")
66
+ .padding(.horizontal, 20)
67
+ .padding(.vertical, 10)
68
+ .glassEffect(in: .capsule)
69
+ ```
70
+
71
+ ### Glass
72
+
73
+ #### Available Styles
74
+
75
+ The `Glass` type exposes three static values — there is no `.prominent`:
76
+
77
+ ```swift
78
+ .glassEffect(.regular) // Standard glass appearance (most common)
79
+ .glassEffect(.clear) // Nearly invisible glass surface
80
+ .glassEffect(.identity) // No-op / pass-through glass
81
+ ```
82
+
83
+ To make a surface appear more prominent, increase the tint opacity instead of reaching for a non-existent `.prominent` property.
84
+
85
+ #### Tinting
86
+
87
+ Add color tint to the glass:
88
+
89
+ ```swift
90
+ .glassEffect(.regular.tint(.blue))
91
+ .glassEffect(.regular.tint(.red.opacity(0.3)))
92
+ ```
93
+
94
+ #### Interactivity
95
+
96
+ Make glass respond to touch/pointer hover:
97
+
98
+ ```swift
99
+ // Interactive glass - responds to user interaction
100
+ .glassEffect(.regular.interactive())
101
+
102
+ // Combined with tint
103
+ .glassEffect(.regular.tint(.blue).interactive())
104
+ ```
105
+
106
+ **Important**: Only use `.interactive()` on elements that actually respond to user input (buttons, tappable views, focusable elements).
107
+
108
+ ## GlassEffectContainer
109
+
110
+ Wraps multiple glass elements for proper visual grouping and spacing.
111
+
112
+ **Glass cannot sample other glass.** The glass material reflects and refracts light by sampling content from an area larger than itself. Nearby glass elements in different containers will produce inconsistent visual results because they cannot sample each other. `GlassEffectContainer` gives grouped elements a shared sampling region, ensuring a consistent appearance.
113
+
114
+ ```swift
115
+ GlassEffectContainer {
116
+ HStack {
117
+ Button("One") { }
118
+ .glassEffect()
119
+ Button("Two") { }
120
+ .glassEffect()
121
+ }
122
+ }
123
+ ```
124
+
125
+ ### With Spacing
126
+
127
+ Control the visual spacing between glass elements:
128
+
129
+ ```swift
130
+ GlassEffectContainer(spacing: 24) {
131
+ HStack(spacing: 24) {
132
+ GlassChip(icon: "pencil")
133
+ GlassChip(icon: "eraser")
134
+ GlassChip(icon: "trash")
135
+ }
136
+ }
137
+ ```
138
+
139
+ **Note**: The container's `spacing` parameter should match the actual spacing in your layout for proper glass effect rendering.
140
+
141
+ > Source: "Build a SwiftUI app with the new design" (WWDC25, session 323)
142
+
143
+ ## Glass Button Styles
144
+
145
+ Built-in button styles for glass appearance:
146
+
147
+ ```swift
148
+ // Standard glass button
149
+ Button("Action") { }
150
+ .buttonStyle(.glass)
151
+
152
+ // Prominent glass button (higher visibility)
153
+ Button("Primary Action") { }
154
+ .buttonStyle(.glassProminent)
155
+ ```
156
+
157
+ ### Custom Glass Buttons
158
+
159
+ For more control, apply glass effect manually:
160
+
161
+ ```swift
162
+ Button(action: { }) {
163
+ Label("Settings", systemImage: "gear")
164
+ .padding()
165
+ }
166
+ .glassEffect(.regular.interactive(), in: .capsule)
167
+ ```
168
+
169
+ ## Morphing Transitions
170
+
171
+ Create smooth transitions between glass elements using `glassEffectID` and `@Namespace`:
172
+
173
+ ```swift
174
+ struct MorphingExample: View {
175
+ @Namespace private var animation
176
+ @State private var isExpanded = false
177
+
178
+ var body: some View {
179
+ GlassEffectContainer {
180
+ if isExpanded {
181
+ ExpandedCard()
182
+ .glassEffect()
183
+ .glassEffectID("card", in: animation)
184
+ } else {
185
+ CompactCard()
186
+ .glassEffect()
187
+ .glassEffectID("card", in: animation)
188
+ }
189
+ }
190
+ .animation(.smooth, value: isExpanded)
191
+ }
192
+ }
193
+ ```
194
+
195
+ ### Requirements for Morphing
196
+
197
+ 1. Both views must have the same `glassEffectID`
198
+ 2. Use the same `@Namespace`
199
+ 3. Wrap in `GlassEffectContainer`
200
+ 4. Apply animation to the container or parent
201
+
202
+ ## Modifier Order
203
+
204
+ **Critical**: Apply `glassEffect` after layout and visual modifiers:
205
+
206
+ ```swift
207
+ // CORRECT order
208
+ Text("Label")
209
+ .font(.headline) // 1. Typography
210
+ .foregroundStyle(.primary) // 2. Color
211
+ .padding() // 3. Layout
212
+ .glassEffect() // 4. Glass effect LAST
213
+
214
+ // WRONG order - glass applied too early
215
+ Text("Label")
216
+ .glassEffect() // Wrong position
217
+ .padding()
218
+ .font(.headline)
219
+ ```
220
+
221
+ ## Complete Examples
222
+
223
+ ### Toolbar with Glass Buttons
224
+
225
+ ```swift
226
+ struct GlassToolbar: View {
227
+ var body: some View {
228
+ if #available(iOS 26, *) {
229
+ GlassEffectContainer(spacing: 16) {
230
+ HStack(spacing: 16) {
231
+ ToolbarButton(icon: "pencil", action: { })
232
+ ToolbarButton(icon: "eraser", action: { })
233
+ ToolbarButton(icon: "scissors", action: { })
234
+ Spacer()
235
+ ToolbarButton(icon: "square.and.arrow.up", action: { })
236
+ }
237
+ .padding(.horizontal)
238
+ }
239
+ } else {
240
+ // Fallback toolbar
241
+ HStack(spacing: 16) {
242
+ // ... fallback implementation
243
+ }
244
+ }
245
+ }
246
+ }
247
+
248
+ struct ToolbarButton: View {
249
+ let icon: String
250
+ let action: () -> Void
251
+
252
+ var body: some View {
253
+ Button(action: action) {
254
+ Image(systemName: icon)
255
+ .font(.title2)
256
+ .frame(width: 44, height: 44)
257
+ }
258
+ .glassEffect(.regular.interactive(), in: .circle)
259
+ }
260
+ }
261
+ ```
262
+
263
+ ### Card with Glass Effect
264
+
265
+ ```swift
266
+ struct GlassCard: View {
267
+ let title: String
268
+ let subtitle: String
269
+
270
+ var body: some View {
271
+ if #available(iOS 26, *) {
272
+ cardContent
273
+ .glassEffect(.regular, in: .rect(cornerRadius: 20))
274
+ } else {
275
+ cardContent
276
+ .background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 20))
277
+ }
278
+ }
279
+
280
+ private var cardContent: some View {
281
+ VStack(alignment: .leading, spacing: 8) {
282
+ Text(title)
283
+ .font(.headline)
284
+ Text(subtitle)
285
+ .font(.subheadline)
286
+ .foregroundStyle(.secondary)
287
+ }
288
+ .padding()
289
+ .frame(maxWidth: .infinity, alignment: .leading)
290
+ }
291
+ }
292
+ ```
293
+
294
+ ### Segmented Control
295
+
296
+ ```swift
297
+ struct GlassSegmentedControl: View {
298
+ @Binding var selection: Int
299
+ let options: [String]
300
+ @Namespace private var animation
301
+
302
+ var body: some View {
303
+ if #available(iOS 26, *) {
304
+ GlassEffectContainer(spacing: 4) {
305
+ HStack(spacing: 4) {
306
+ ForEach(options.indices, id: \.self) { index in
307
+ Button(options[index]) {
308
+ withAnimation(.smooth) {
309
+ selection = index
310
+ }
311
+ }
312
+ .padding(.horizontal, 16)
313
+ .padding(.vertical, 8)
314
+ .glassEffect(
315
+ selection == index
316
+ ? .regular.tint(.accentColor.opacity(0.4)).interactive()
317
+ : .regular.interactive(),
318
+ in: .capsule
319
+ )
320
+ .glassEffectID(selection == index ? "selected" : "option\(index)", in: animation)
321
+ }
322
+ }
323
+ .padding(4)
324
+ }
325
+ } else {
326
+ Picker("Options", selection: $selection) {
327
+ ForEach(options.indices, id: \.self) { index in
328
+ Text(options[index]).tag(index)
329
+ }
330
+ }
331
+ .pickerStyle(.segmented)
332
+ }
333
+ }
334
+ }
335
+ ```
336
+
337
+ ## Fallback Strategies
338
+
339
+ ### Using Materials
340
+
341
+ ```swift
342
+ if #available(iOS 26, *) {
343
+ content.glassEffect()
344
+ } else {
345
+ content.background(.ultraThinMaterial, in: RoundedRectangle(cornerRadius: 16))
346
+ }
347
+ ```
348
+
349
+ ### Available Materials for Fallback
350
+
351
+ - `.ultraThinMaterial` - Closest to glass appearance
352
+ - `.thinMaterial` - Slightly more opaque
353
+ - `.regularMaterial` - Standard blur
354
+ - `.thickMaterial` - More opaque
355
+ - `.ultraThickMaterial` - Most opaque
356
+
357
+ ### Conditional Modifier Extension
358
+
359
+ ```swift
360
+ extension View {
361
+ @ViewBuilder
362
+ func glassEffectWithFallback(
363
+ _ glass: Glass = .regular,
364
+ in shape: some Shape = .rect,
365
+ fallbackMaterial: Material = .ultraThinMaterial
366
+ ) -> some View {
367
+ if #available(iOS 26, *) {
368
+ self.glassEffect(glass, in: shape)
369
+ } else {
370
+ self.background(fallbackMaterial, in: shape)
371
+ }
372
+ }
373
+ }
374
+ ```
375
+
376
+ ## Design System Notes
377
+
378
+ ### Toolbar Icons
379
+
380
+ In the new design, toolbar icons use **monochrome rendering** by default. The monochrome palette reduces visual noise and maintains legibility. Use `tint(_:)` only to convey meaning (e.g., a call to action), not for visual effect.
381
+
382
+ ### Sheet Presentations
383
+
384
+ Partial-height sheets use a Liquid Glass background by default. If you previously used `presentationBackground(_:)` with a custom background, consider removing it to let the new material shine. Sheets can morph out of the glass controls that present them using `navigationZoomTransition`.
385
+
386
+ ### Scroll Edge Effects
387
+
388
+ An automatic scroll edge effect blurs and fades content under system toolbars to keep controls legible. Remove any custom background-darkening effects behind bar items, as they will interfere.
389
+
390
+ > Source: "Build a SwiftUI app with the new design" (WWDC25, session 323)
391
+
392
+ ## Best Practices
393
+
394
+ ### Do
395
+
396
+ - Use `GlassEffectContainer` for grouped glass elements (glass cannot sample other glass)
397
+ - Apply glass after layout modifiers
398
+ - Use `.interactive()` only on tappable elements
399
+ - Match container spacing with layout spacing
400
+ - Provide material-based fallbacks for older iOS
401
+ - Keep glass shapes consistent within a feature
402
+ - Remove custom `presentationBackground(_:)` on sheets to use the default glass material
403
+
404
+ ### Don't
405
+
406
+ - Apply glass to every element (use sparingly)
407
+ - Use `.interactive()` on static content
408
+ - Mix different corner radii arbitrarily
409
+ - Forget iOS version checks
410
+ - Apply glass before padding/frame modifiers
411
+ - Nest `GlassEffectContainer` unnecessarily
412
+ - Add custom darkening backgrounds behind toolbars (conflicts with scroll edge effect)
413
+
414
+ ## Checklist
415
+
416
+ - [ ] `#available(iOS 26, *)` with fallback
417
+ - [ ] `GlassEffectContainer` wraps grouped elements
418
+ - [ ] `.glassEffect()` applied after layout modifiers
419
+ - [ ] `.interactive()` only on user-interactable elements
420
+ - [ ] `glassEffectID` with `@Namespace` for morphing
421
+ - [ ] Consistent shapes and spacing across feature
422
+ - [ ] Container spacing matches layout spacing
423
+ - [ ] Tint opacity used instead of non-existent `.prominent` for emphasis