text stringlengths 3 8.33k | repo stringclasses 52
values | path stringlengths 6 141 | language stringclasses 35
values | sha stringlengths 64 64 | chunk_index int32 0 273 | n_tokens int32 1 896 |
|---|---|---|---|---|---|---|
defer { lock.unlock() }
items[key] = value
}
}
```
### Risks
- No compile-time safety
- Easy to introduce data races
- Must manually ensure all access uses lock
```swift
final class Cache: @unchecked Sendable {
private let lock = NSLock()
private var items: [String: Data] = [:]
// ⚠️ For... | openai-build-week | .agents/skills/swift-concurrency/references/sendable.md | Markdown | 08d17ced011ed4857a488f29a266c06c7b5aa4839d49de9ba146d0c4c1044387 | 2 | 896 |
: @unchecked Sendable {
private var balance: Int = 0
private let lock = NSLock()
func deposit(amount: Int) {
lock.lock()
balance += amount
lock.unlock()
}
func getBalance() -> Int {
lock.lock()
defer { lock.unlock() }
return balance
}
}
`... | openai-build-week | .agents/skills/swift-concurrency/references/sendable.md | Markdown | 7770700e205fbb8d6be20e3d22a18f500cad51cad267a424f60ab88f35e5191d | 3 | 707 |
# Tasks
Use this when:
- You need to start async work from synchronous code.
- You are choosing between `Task`, `async let`, and task groups.
- You need cancellation, priorities, or structured vs unstructured guidance.
Skip this file if:
- The problem is mainly actor isolation or sendability. Use `actors.md` or `se... | openai-build-week | .agents/skills/swift-concurrency/references/tasks.md | Markdown | f4fb546850d9e22051eb1c380518a8257807d3af39a6258f11d2c5b98f3f6020 | 0 | 896 |
Task {
"Success"
}
```
### Awaiting results
```swift
do {
let result = try await task.value
} catch {
// Handle error
}
```
### Handling errors internally
```swift
let safeTask: Task<String, Never> = Task {
do {
return try await riskyOperation()
} catch {
return "Fallback value"
... | openai-build-week | .agents/skills/swift-concurrency/references/tasks.md | Markdown | 4cb3a073fa9172545377a29f597fd5d49d2ac3b2488f45ca5085b56050b27316 | 1 | 896 |
:
```swift
await withDiscardingTaskGroup { group in
group.addTask { await logEvent("user_login") }
group.addTask { await preloadCache() }
group.addTask { await syncAnalytics() }
}
```
### Benefits
- More memory efficient (doesn't store results)
- No `next()` calls needed
- Automatically waits for complet... | openai-build-week | .agents/skills/swift-concurrency/references/tasks.md | Markdown | 83720ac3d915b073a6767f787a6e128d25369d44c6bfce739eab5baee68145b0 | 2 | 896 |
high) {
Task.detached {
// Runs at .medium (default)
}
}
```
### Priority escalation
System automatically elevates priority to prevent priority inversion:
- Actor waiting on lower-priority task
- High-priority task awaiting `.value` of lower-priority task
> **Course Deep Dive**: This topic is covered... | openai-build-week | .agents/skills/swift-concurrency/references/tasks.md | Markdown | 211bf626bdde5bab88fca74173bd0bdbaf705b9da43796685ca0fa4a72138868 | 3 | 896 |
*: This topic is covered in detail in [Lesson 3.14: Creating a Task timeout handler using a Task Group (advanced)](https://www.swiftconcurrencycourse.com?utm_source=github&utm_medium=agent-skill&utm_campaign=lesson-reference)
## Common Patterns
### Sequential with early exit
```swift
let user = try await fetchUser()... | openai-build-week | .agents/skills/swift-concurrency/references/tasks.md | Markdown | 1658aa96ed6ec08f70ac764c3d90e7c9168eed214c9a3914491922c7b73b0272 | 4 | 552 |
# Testing Concurrent Code
Use this when:
- You are writing async tests.
- A test is flaky because of task scheduling or actor isolation.
- You need to replace XCTest waiting APIs or verify deallocation.
Skip this file if:
- You mainly need production ownership guidance. Use `actors.md`, `tasks.md`, or `memory-manag... | openai-build-week | .agents/skills/swift-concurrency/references/testing.md | Markdown | 3e91f07335f1990ebcd2547a3fe1d644344351b1747902954734e352adaa8cf9 | 0 | 896 |
Or apply to individual test
@Test(DatabaseTrait())
func specificTest() async throws {
// Test code
}
```
**Use when**: Need async cleanup after each test.
## Handling Flaky Tests
### Problem: Race conditions
```swift
@Test
@MainActor
func isLoadingState() async throws {
let fetcher = ImageFetcher()
... | openai-build-week | .agents/skills/swift-concurrency/references/testing.md | Markdown | a35e72ed8fbbdc2f48e4e3e1e6bc8f3331d9242f66899d0c9b72ae62a161da2d | 1 | 896 |
Test
func cancellationStopsWork() async throws {
let processor = DataProcessor()
let task = Task {
try await processor.processLargeDataset()
}
task.cancel()
do {
try await task.value
Issue.record("Should have thrown cancellation error")
} catch is Cancellat... | openai-build-week | .agents/skills/swift-concurrency/references/testing.md | Markdown | 149c4aee89b58f04abcee1a93cd3a4a271fb852f22acf3d11ca5f798b5020171 | 2 | 896 |
# Deadlock
**Cause**: Using `wait(for:)` in async context.
**Solution**: Use `await fulfillment(of:)` instead.
### Confirmation fails
**Cause**: Not awaiting async work in confirmation block.
**Solution**: Add `await` before async calls.
### Actor isolation error
**Cause**: Test not marked with required actor.
... | openai-build-week | .agents/skills/swift-concurrency/references/testing.md | Markdown | 945beeeca01412ec7d6f61e3ba2de87dd08d24a2bdeface5088153b48b2c05dc | 3 | 438 |
# Threading
Use this when:
- You need to understand the relationship between tasks and threads.
- You are debugging suspension points, actor reentrancy, or unexpected execution contexts.
- You need Swift 6.2 behavior guidance (`nonisolated async`, `@concurrent`, `nonisolated(nonsending)`).
Skip this file if:
- You ... | openai-build-week | .agents/skills/swift-concurrency/references/threading.md | Markdown | e760816c8dffc0e02d96b5c8c9cfe5a0c0e8ef2278a3b0d80ddeeddef0c6b757 | 0 | 896 |
&utm_medium=agent-skill&utm_campaign=lesson-reference)
## Suspension Points
### What is a suspension point?
Moment where task **may** pause to allow other work. Marked by `await`.
```swift
let data = await fetchData() // Potential suspension
```
**Critical**: `await` marks *possible* suspension, not guaranteed. If... | openai-build-week | .agents/skills/swift-concurrency/references/threading.md | Markdown | 1adf8c8813721b3c49507a4b6dbab2089a8600a54ba0abf836f48647374ee736 | 1 | 896 |
Synchronous prefix DOES contain main-actor work — keep inheritance
Task {
print("debug") // trivial, non-main — rides along
self.isLoading = true // needs @MainActor, before any await
await fetchData()
}
```
The delayed-retry `Task.sleep` pattern (see `performance.md` "Match Task entry i... | openai-build-week | .agents/skills/swift-concurrency/references/threading.md | Markdown | 4a5b082de603a5f10fd6f1852c1fbedaf3a56c304f56fc46d380bbe0db77f0f3 | 2 | 896 |
MainActor default
```swift
// With @MainActor as default:
func f() {} // Inferred: @MainActor
class C {
init() {} // Inferred: @MainActor
static var value = 10 // Inferred: @MainActor
}
@MyActor
struct S {
func f() {} // Inferred: @MyActor (explicit override)
}
> **Course Deep Dive**: This topic is cov... | openai-build-week | .agents/skills/swift-concurrency/references/threading.md | Markdown | fbb4a8d5387405ce23157d3cd35b636691c5563922962cb9c9bcd4d4f6989595 | 3 | 896 |
→ nonisolated(nonsending)
└─ Need different isolation? → Make Sendable or refactor
```
## GCD to Isolation Domain Migration
Instead of asking "what thread should this run on?" ask "what isolation domain should own this work?"
- `DispatchQueue.main.async { }` → `@MainActor func updateUI()`
- `DispatchQueue.global().a... | openai-build-week | .agents/skills/swift-concurrency/references/threading.md | Markdown | 83bca925de506e7b62a6e4201695c63dae80bc177a3ba014f27dacce9d425270 | 4 | 459 |
---
name: swift-testing-expert
description: 'Expert guidance for Swift Testing: test structure, #expect/#require macros, traits and tags, parameterized tests, test plans, parallel execution, async waiting patterns, and XCTest migration. Use when writing new Swift tests, modernizing XCTest suites, debugging flaky tests,... | openai-build-week | .agents/skills/swift-testing-expert/SKILL.md | Markdown | 0a05296804bb35fd4a2e099b8e8af82d38361348c18e3b9d495a482d8d66cbd0 | 0 | 896 |
diagnostics.
- Test-plan include/exclude by names -> use tags and tag-based filters instead.
## Verification checklist
- Confirm each test has a single clear behavior and expressive display name when needed.
- Confirm prerequisites use `#require` where failure should stop the test.
- Confirm repeated logic is paramet... | openai-build-week | .agents/skills/swift-testing-expert/SKILL.md | Markdown | cf4a246222d3c3ce9afef2da96857d6b68bd5668e2177965b8aed84ee8e2edff | 1 | 216 |
# Swift Testing Reference Index
- `fundamentals.md` - `@Test`, suites, structure, naming, and baseline patterns
- `expectations.md` - `#expect`, `#require`, throw validation, and failure readability
- `traits-and-tags.md` - traits, tags, bug linking, conditions, and test-plan filtering
- `parameterized-testing.md` - s... | openai-build-week | .agents/skills/swift-testing-expert/references/_index.md | Markdown | 623f23b0e14d363928bfc6b8ed54c89c6d420fde809ee79c0f6e37ed2c4aa965 | 0 | 236 |
# Async Testing and Waiting
## When to use this reference
Use this file when tests involve async/await functions, completion handlers, streams/events, or timing-related flakiness.
## Preferred approach
- Use async test functions and `await` naturally.
- Keep async test code close to production async patterns.
- Pre... | openai-build-week | .agents/skills/swift-testing-expert/references/async-testing-and-waiting.md | Markdown | e5f7d016a95d976774d7f26a80be07acf204306aa874f60d6f501aec141c6ceb | 0 | 684 |
# Expectations
## When to use this reference
Use this file when writing assertions, migrating from `XCTAssert*`, testing thrown errors, or documenting known failures.
## `#expect` as the default
- Use `#expect` for most assertions.
- Pass natural Swift expressions (`==`, `>`, `.contains`, `.isEmpty`, etc.).
- Rely ... | openai-build-week | .agents/skills/swift-testing-expert/references/expectations.md | Markdown | e3d4a57b5d162f49e8f7135e2a020eb1c2af0301782d31c1e4ac3d51a9a0dac5 | 0 | 814 |
# Fundamentals
## When to use this reference
Use this file when creating new Swift Testing suites or refactoring test structure before deeper topics like traits, parameterization, or migration.
## Building blocks
- Import `Testing` only in test targets.
- Use `@Test` to declare tests explicitly (global function or ... | openai-build-week | .agents/skills/swift-testing-expert/references/fundamentals.md | Markdown | ad3af7d6ce9a31c2f8222a88baf9a5631de6443d2ad671764e2d183bba7019f3 | 0 | 855 |
# Migration from XCTest
## When to use this reference
Use this file for incremental migration of existing XCTest code to Swift Testing while preserving safety and CI signal.
## Coexistence strategy
- Swift Testing and XCTest can coexist in the same target.
- Migrate incrementally; do not block migration on full rew... | openai-build-week | .agents/skills/swift-testing-expert/references/migration-from-xctest.md | Markdown | f94a3bc08fb59358689a84d9d6a2838154dc96904e53457e068d00df5b0671ef | 0 | 782 |
# Parallelization and Isolation
## When to use this reference
Use this file when tests are flaky in CI, have hidden ordering dependencies, or need to scale execution speed safely.
## Default execution model
- Swift Testing runs test functions in parallel by default.
- Execution order is randomized to expose hidden ... | openai-build-week | .agents/skills/swift-testing-expert/references/parallelization-and-isolation.md | Markdown | 209cd458d3fbc8a2830265252714f5ac09abe93100b3b2582034fa7ea1a0568c | 0 | 534 |
# Parameterized Testing
## When to use this reference
Use this file when you have repeated tests with identical logic and only input changes.
## When to parameterize
- Use one parameterized test when behavior is identical and only input changes.
- Replace copy-pasted tests and in-test `for` loops with `@Test(argume... | openai-build-week | .agents/skills/swift-testing-expert/references/parameterized-testing.md | Markdown | cb7a93003184207752730d3c0d967bd7929f7a87616ed8f727dad15586ecc789 | 0 | 896 |
`swift
// ❌ Fragile: reordering either enum misaligns all pairs
enum Ingredient: CaseIterable { case rice, potato, egg }
enum Dish: CaseIterable { case onigiri, fries, omelette }
@Test(arguments: zip(Ingredient.allCases, Dish.allCases))
func cook(_ ingredient: Ingredient, into dish: Dish) {
#expect(cook(ingredient) =... | openai-build-week | .agents/skills/swift-testing-expert/references/parameterized-testing.md | Markdown | 6023650c4af2208b60c87da6529055090e759de47097eeb19b8d59764b010bbe | 1 | 896 |
Monday",
// this test still passes because rawValue has the same casing bug.
@Test(arguments: Day.allCases)
func dayLabel(day: Day) {
#expect(format(day) == day.rawValue)
}
// ✅ Concrete: each expectation is an independent data point.
@Test(arguments: [
(Day.monday, "Monday"),
(.friday, "Friday")
])
func dayLabe... | openai-build-week | .agents/skills/swift-testing-expert/references/parameterized-testing.md | Markdown | 836b8700dd113dd40779be4ed3d53c26c9239c0a5bc10cae3e9dbf9c26007ff1 | 2 | 547 |
# Performance and Best Practices
## When to use this reference
Use this file when test runs are slow, flaky, or not scaling in CI, and when you need practical patterns for fast, deterministic Swift Testing suites.
## Core principles
- Prefer deterministic tests over timing-sensitive tests.
- Prefer synchronous veri... | openai-build-week | .agents/skills/swift-testing-expert/references/performance-and-best-practices.md | Markdown | 1eca0159f5b30677b48fa1074b1f0f5de81e5ef054aa4928b28b40647f5a62b6 | 0 | 896 |
]
init() {
rates = ["USD": 1.0, "EUR": 0.92]
}
@Test func hasEURRate() {
#expect(rates["EUR"] != nil)
}
}
```
## 7) Use `.serialized` narrowly
```swift
import Testing
@Suite(.serialized)
struct TemporarySerialDBTests {
@Test func migrationA() async throws { #expect(true) }
@Test func migrationB() async thr... | openai-build-week | .agents/skills/swift-testing-expert/references/performance-and-best-practices.md | Markdown | db0be456526046770c410048a038edd8880e1ec08a4b8d65d62dee593e6d986c | 1 | 239 |
# Traits and Tags
## When to use this reference
Use this file when controlling test execution behavior, linking bug context, and organizing large test suites for targeted runs and CI filtering.
## Trait categories
- **Informational**: display names, bug links, tags.
- **Conditional**: `.enabled(if:)`, `.disabled(..... | openai-build-week | .agents/skills/swift-testing-expert/references/traits-and-tags.md | Markdown | 17dd0b7182f0abdf51f538a6bcc139ef6d501325575476c63a6d5f933312b49e | 0 | 720 |
# Xcode Workflows
## When to use this reference
Use this file when debugging failures quickly in Xcode, configuring focused test plans, and extracting insights from large test reports.
## Test Navigator usage
- Run tests at function, suite, tag, and argument level.
- In parameterized tests, rerun only failing argum... | openai-build-week | .agents/skills/swift-testing-expert/references/xcode-workflows.md | Markdown | f43407527c30bc1e346d32e4f54a5105a9c61bd071abfbfaa7b91107b4451c94 | 0 | 473 |
---
name: swiftui-expert-skill
description: Use when writing, reviewing, or refactoring SwiftUI code for iOS or macOS, including state management and `@Observable` data flow, view composition and invalidation/performance, lists and `ForEach` identity, environment usage, localization, animations, Liquid Glass adoption, ... | openai-build-week | .agents/skills/swiftui-expert-skill/SKILL.md | Markdown | b451a27f5ca173302d09c5e493faf7c3a926fa7103a63bf45e14a3a2a0f10c63 | 0 | 896 |
've finished exercising the app, `touch /tmp/stop-trace`. The script cleanly SIGINTs xctrace and waits up to 60s for finalisation.
5. **Analyse** the resulting trace (flow into the "Trace-driven improvement" workflow below).
### Trace-driven improvement (Instruments `.trace` provided)
Trigger whenever the user's reque... | openai-build-week | .agents/skills/swiftui-expert-skill/SKILL.md | Markdown | 2d6634de0138b4cef834febb11c3525fdba9c29f633a08532bfef01772316e1e | 1 | 896 |
and navigation | `references/sheet-navigation-patterns.md` |
| ScrollView | `references/scroll-patterns.md` |
| Focus management | `references/focus-patterns.md` |
| Animations (basics) | `references/animation-basics.md` |
| Animations (transitions) | `references/animation-transitions.md` |
| Animations (advanced) | `r... | openai-build-week | .agents/skills/swiftui-expert-skill/SKILL.md | Markdown | 9d2cad66c28a0fd665ce5a5caf82c409910ea7592b83debf60d403e09291927e | 2 | 896 |
, `Animatable`
- `references/animation-advanced.md` -- Phase/keyframe animations (iOS 17+), `@Animatable` macro (iOS 26+)
- `references/charts.md` -- Swift Charts marks, axes, selection, styling, Chart3D (iOS 26+)
- `references/charts-accessibility.md` -- Charts VoiceOver, Audio Graph, fallback strategies
- `references... | openai-build-week | .agents/skills/swiftui-expert-skill/SKILL.md | Markdown | b9fdeb20c9786419fae70ccfe52cec22bdc8ed081da8a5906d1c8904fc4e21fe | 3 | 471 |
# SwiftUI Accessibility Patterns Reference
## Table of Contents
- [Core Principle](#core-principle)
- [Dynamic Type and @ScaledMetric](#dynamic-type-and-scaledmetric)
- [Accessibility Traits](#accessibility-traits)
- [Decorative Images](#decorative-images)
- [Element Grouping](#element-grouping)
- [Custom Controls](#... | openai-build-week | .agents/skills/swiftui-expert-skill/references/accessibility-patterns.md | Markdown | d5ab60e324acf281d2629d1ce9570cc24b662e1ffd7e004d52bb289b088ba635 | 0 | 896 |
(true)
```
## Element Grouping
### .combine -- Auto-join child labels
```swift
HStack {
Image(systemName: "star.fill")
Text("Favorites")
Text("(\(count))")
}
.accessibilityElement(children: .combine)
```
VoiceOver reads all child labels as one element, separated by commas.
### .ignore -- Manual label f... | openai-build-week | .agents/skills/swiftui-expert-skill/references/accessibility-patterns.md | Markdown | 73eae09c9abd38708fbc796601c5812231a5579f10a6cc578af3e44008c9a485 | 1 | 563 |
# SwiftUI Advanced Animations
Transactions, phase animations (iOS 17+), keyframe animations (iOS 17+), completion handlers (iOS 17+), and `@Animatable` macro (iOS 26+).
## Table of Contents
- [Transactions](#transactions)
- [Phase Animations (iOS 17+)](#phase-animations-ios-17)
- [Keyframe Animations (iOS 17+)](#keyf... | openai-build-week | .agents/skills/swiftui-expert-skill/references/animation-advanced.md | Markdown | 823f4e5afbb90952e499a65c872fe0abeeee7c4124659cbf734a05db4dd8a5c9 | 0 | 896 |
Good vs Bad
```swift
// GOOD - use phaseAnimator for multi-step sequences
.phaseAnimator([0, -10, 10, 0], trigger: trigger) { content, offset in
content.offset(x: offset)
}
// BAD - manual DispatchQueue sequencing
Button("Animate") {
withAnimation(.easeOut(duration: 0.1)) { offset = -10 }
DispatchQueue.ma... | openai-build-week | .agents/skills/swiftui-expert-skill/references/animation-advanced.md | Markdown | f07d45c0542749351cf89d8136867bcb883496889b631774fca5fada8db6e501 | 1 | 896 |
bounceCount) complete"
}
}
// BAD - completion only fires ONCE (no value parameter)
Circle()
.scaleEffect(bounceCount % 2 == 0 ? 1.0 : 1.2)
.animation(.spring, value: bounceCount)
.transaction { transaction in // No value!
transaction.addAnimationCompletion {
completionCoun... | openai-build-week | .agents/skills/swiftui-expert-skill/references/animation-advanced.md | Markdown | 830910686c8d06d9023f3fdf7d0408cc2d77e242281957e380923d640f554a58 | 2 | 883 |
# SwiftUI Animation Basics
Core animation concepts, implicit vs explicit animations, timing curves, and performance patterns.
## Table of Contents
- [Core Concepts](#core-concepts)
- [Implicit Animations](#implicit-animations)
- [Explicit Animations](#explicit-animations)
- [Animation Placement](#animation-placement)... | openai-build-week | .agents/skills/swiftui-expert-skill/references/animation-basics.md | Markdown | 40db8888e5ab33761480d34f5fc368b4bd3934f48b5fb670b8b74658e60870ad | 0 | 896 |
.animation(.default.repeatCount(3, autoreverses: true), value: flag)
```
### Good vs Bad Timing
```swift
// GOOD - appropriate timing for interaction type
Button("Tap") {
withAnimation(.spring(response: 0.3, dampingFraction: 0.7)) {
isActive.toggle()
}
}
.scaleEffect(isActive ? 0.95 : 1.0)
// BAD - t... | openai-build-week | .agents/skills/swiftui-expert-skill/references/animation-basics.md | Markdown | 80b40ad7215112523c2e65b28a79b6718ff0df429fc9d8d191ce8446ecccd6ad | 1 | 811 |
# SwiftUI Transitions
Transitions for view insertion/removal, custom transitions, and the Animatable protocol.
## Table of Contents
- [Property Animations vs Transitions](#property-animations-vs-transitions)
- [Basic Transitions](#basic-transitions)
- [Asymmetric Transitions](#asymmetric-transitions)
- [Custom Transi... | openai-build-week | .agents/skills/swiftui-expert-skill/references/animation-transitions.md | Markdown | fa8a231153c6b73ce26051e4d5853b240a39789f88c3840d628d23f7f38ede3e | 0 | 896 |
some View {
content
.blur(radius: phase.isIdentity ? 0 : radius)
.opacity(phase.isIdentity ? 1 : 0)
}
}
// Usage
.transition(BlurTransition(radius: 10))
```
### Good vs Bad Custom Transitions
```swift
// GOOD - reusable transition
if showContent {
ContentView()
.transi... | openai-build-week | .agents/skills/swiftui-expert-skill/references/animation-transitions.md | Markdown | 0f7cf57cad0bf514c6fa9cf47212c8c0229305fe8d1372df320a6ec135be6952 | 1 | 839 |
# Swift Charts Accessibility, Fallback, and Resources
## Table of Contents
- [Accessibility](#accessibility)
- [Meaningful Labels](#meaningful-labels)
- [Custom Audio Graphs](#custom-audio-graphs)
- [Composite Example](#composite-example)
- [Fallback Strategies](#fallback-strategies)
- [Version Breakdown](#vers... | openai-build-week | .agents/skills/swiftui-expert-skill/references/charts-accessibility.md | Markdown | 1c640cd36235ab736b76b88881f149b3e601c3b8d1d28d514ed5ea99652f0f5a | 0 | 896 |
Fallback Strategies
Gate advanced APIs with `#available` and provide a fallback chart without the gated features. Because chart modifiers like `.chartXSelection` change the return type, you must duplicate the entire `Chart` — you cannot conditionally apply the modifier:
### Version Breakdown
- iOS 16+: `Chart`, cust... | openai-build-week | .agents/skills/swiftui-expert-skill/references/charts-accessibility.md | Markdown | 6516742108bb7436fb5c76c0b81b166360dcc35970101445a9ccc59d42bc23f3 | 1 | 740 |
# SwiftUI Charts Reference
## Table of Contents
- [Overview](#overview)
- [Availability](#availability)
- [Core APIs](#core-apis)
- [Chart Types](#chart-types)
- [Axis Tweaks](#axis-tweaks)
- [Selection APIs](#selection-apis)
- [Annotations](#annotations)
- [ChartProxy and Custom Touch Handling](#chartproxy-and-custo... | openai-build-week | .agents/skills/swiftui-expert-skill/references/charts.md | Markdown | c74b3e26a4b116e5da18e1dbdbc65d500b50f3bf034b908c413f150b462f7e85 | 0 | 896 |
.interpolationMethod(.monotone)
```
Interpolation methods: `.linear`, `.monotone`, `.cardinal`, `.catmullRom`, `.stepStart`, `.stepCenter`, `.stepEnd`. Cardinal and Catmull-Rom accept optional tension/alpha parameters.
### AreaMark
```swift
AreaMark(
x: .value("Hour", sample.hour),
y: .value("Temperature", s... | openai-build-week | .agents/skills/swiftui-expert-skill/references/charts.md | Markdown | c7210af37712847846bc020b87960d7c47df0588e259964700bd91a1bc19cc1d | 1 | 896 |
: `.chart3DCameraProjection(.orthographic)` (default, precise measurements) or `.perspective` (depth effect)
- **Pose presets**: `.chart3DPose(.default)`, `.front`, `.back`, `.left`, `.right`
- **Custom pose**: `.chart3DPose(azimuth: .degrees(45), inclination: .degrees(30))`
- On visionOS, Chart3D supports natural 3D i... | openai-build-week | .agents/skills/swiftui-expert-skill/references/charts.md | Markdown | e1a67930fe6ae578e559f4ccb116f8413bfc03681c5250abd77650758f61d9d1 | 2 | 896 |
x: $scrollX)
```
## Selection APIs
### Single-Value Selection
Use `chartXSelection(value:)` or `chartYSelection(value:)` for one selected value.
```swift
@State private var selectedDate: Date?
Chart(steps) { day in
LineMark(x: .value("Day", day.date), y: .value("Steps", day.count))
if let selectedDate {
... | openai-build-week | .agents/skills/swiftui-expert-skill/references/charts.md | Markdown | 51bf488c8eae2de9ca857217dbc19d8feeb544a1154ca6be537574bbba187dfb | 3 | 896 |
`selectYValue(at:)`, `selectXRange(from:to:)`, and `selectYRange(from:to:)` for driving built-in selection from custom gestures
- `plotFrame` (iOS 17+) or `plotAreaFrame` (iOS 16) with `plotSize` for converting between gesture coordinates and the plot area
`select*` ChartProxy selection methods and `chartGesture` are ... | openai-build-week | .agents/skills/swiftui-expert-skill/references/charts.md | Markdown | d5fd857305fbefa1723da16ba7e3f19434c3e268bba568f1c9a8b12d6acd7414 | 4 | 896 |
can match old and new data points and animate transitions between them.
## Best Practices
### Do
- Use semantic `.value(_, _)` labels so axes and accessibility read clearly
- Prefer `Identifiable` models (or explicit `id:`) for stable chart data identity
- Use `foregroundStyle(by:)` for categorical series to get aut... | openai-build-week | .agents/skills/swiftui-expert-skill/references/charts.md | Markdown | ede6390583662b1e64a39c800e38de9023d02ba82d7757b75efbfb8f0aa15e84 | 5 | 344 |
# SwiftUI Focus Patterns Reference
## Table of Contents
- [@FocusState](#focusstate)
- [Making Views Focusable](#making-views-focusable)
- [Focused Values for Commands and Menus](#focused-values-for-commands-and-menus)
- [Default Focus](#default-focus)
- [Focus Scope and Sections](#focus-scope-and-sections)
- [Focus ... | openai-build-week | .agents/skills/swiftui-expert-skill/references/focus-patterns.md | Markdown | 7213fab0f68ab3d362b473aee337c2abcd1fb01aa3c9de5db556288f1e3fb6e8 | 0 | 896 |
swift
extension FocusedValues {
@Entry var selectedDocument: Binding<Document>?
}
```
Focused values are typically optional (default is `nil` when no view publishes them), but you can also use non-optional entries when you have a sensible default value.
### Publish from views
```swift
// View-scoped: available w... | openai-build-week | .agents/skills/swiftui-expert-skill/references/focus-patterns.md | Markdown | 6257caa0bae9b79b5146cd3894c4f43cf86531c086518a571bd81ffee4ecff5d | 1 | 896 |
Works like `.focused` but targets the search bar.
```swift
@FocusState private var isSearchFocused: Bool
NavigationStack {
ContentView()
.searchable(text: $query)
.searchFocused($isSearchFocused)
}
// Programmatically focus the search bar
Button("Search") { isSearchFocused = true }
```
## Common... | openai-build-week | .agents/skills/swiftui-expert-skill/references/focus-patterns.md | Markdown | d9764e8379185399ad309ed781bb9d484c189e9c160fece610e0b6cfcd00d747 | 2 | 459 |
# SwiftUI Image Optimization Reference
## Table of Contents
- [AsyncImage Best Practices](#asyncimage-best-practices)
- [Image Decoding and Downsampling (Optional Optimization)](#image-decoding-and-downsampling-optional-optimization)
- [UIImage Loading and Memory](#uiimage-loading-and-memory)
- [SF Symbols](#sf-symbo... | openai-build-week | .agents/skills/swiftui-expert-skill/references/image-optimization.md | Markdown | e6d9973843fb87eb7fe8fd82140b8b0bf0e233f94ccfb8f1a41ceb730bb10103 | 0 | 896 |
Optimization
Mention this optimization when you see `UIImage(data:)` usage, particularly in:
- Scrollable content (List, ScrollView with LazyVStack/LazyHStack)
- Grid layouts with many images
- Image galleries or carousels
- Any scenario where large images are displayed at smaller sizes
**Don't automatically apply it... | openai-build-week | .agents/skills/swiftui-expert-skill/references/image-optimization.md | Markdown | 2f49285dbe8b63b49e527968ef00db7f4be3743a219c2b1c86c2668a09175f4b | 1 | 598 |
# Latest SwiftUI APIs Reference
> Based on a comparison of Apple's documentation using the Sosumi MCP, we found the latest recommended APIs to use.
> This file lists *what* the modern replacements are. For *how to behave* when you find a soft-deprecated API — when to migrate, when to leave it alone, and the scoping r... | openai-build-week | .agents/skills/swiftui-expert-skill/references/latest-apis.md | Markdown | 4b7b5b8440e9f8fda31caaeff09d15c9ad63eb3efc9a23a181974af375b661dd | 0 | 896 |
use `.alert(_:isPresented:actions:message:)`** instead of `alert(isPresented:content:)`.
Both take a title `String`, `isPresented: Binding<Bool>`, an `actions` builder with `Button` items (supporting `role: .destructive` / `.cancel`), and an optional `message` builder:
```swift
.alert("Delete Item?", isPresented: $sh... | openai-build-week | .agents/skills/swiftui-expert-skill/references/latest-apis.md | Markdown | b30f7765d4cadde12c9a4a4cd4cc9abb6764fd3820cf864c885f4f68b374e2e3 | 1 | 896 |
. The modern variants provide either both old and new values, or a no-parameter closure.
- **No-parameter** (most common): `.onChange(of: value) { doSomething() }`
- **Old and new values**: `.onChange(of: value) { old, new in ... }`
- **With initial trigger**: `.onChange(of: value, initial: true) { ... }`
- **Deprecat... | openai-build-week | .agents/skills/swiftui-expert-skill/references/latest-apis.md | Markdown | 9c97a33a8fdc6faa2547b45103466e3c057bc6cae5893c0dde6e63ee625d1192 | 2 | 896 |
behavior.**
```swift
ScrollView {
// content
}
.scrollEdgeEffectStyle(.soft, for: .top)
```
### Background Extension
**Use `backgroundExtensionEffect()` for edge-extending blurred backgrounds.**
Views behind a Liquid Glass sidebar can appear clipped. This modifier mirrors and blurs content outside the safe area... | openai-build-week | .agents/skills/swiftui-expert-skill/references/latest-apis.md | Markdown | 788aa11a5ce7321e3bea324935480d7613563af9bc42ae25784e15e67e910e72 | 3 | 896 |
{
ToolbarItem {
Button("Add", systemImage: "plus") { showSheet = true }
.navigationTransitionSource(id: "addSheet", namespace: namespace)
}
}
.sheet(isPresented: $showSheet) {
AddItemView()
.navigationTransitionDestination(id: "addSheet", namespace: namespace)
}
```
> Source: "B... | openai-build-week | .agents/skills/swiftui-expert-skill/references/latest-apis.md | Markdown | 3de7531d3181b74d4d5701f67f842ab14e360ad2d08afd888103de4aac21909e | 4 | 896 |
| `ignoresSafeArea(_:edges:)` | iOS 15+ |
| `colorScheme(_:)` | `preferredColorScheme(_:)` | iOS 15+ |
| `foregroundColor(_:)` | `foregroundStyle(_:)` | iOS 15+ |
| `cornerRadius(_:)` | `clipShape(.rect(cornerRadius:))` | iOS 15+ |
| `actionSheet(...)` | `confirmationDialog(...)` | iOS 15+ |
| `alert(isPresented:conten... | openai-build-week | .agents/skills/swiftui-expert-skill/references/latest-apis.md | Markdown | 157fb3b8af352cd9d956a18176e70a63ff1252d48fb333aeb3510d2de8cc0b94 | 5 | 615 |
# SwiftUI Layout Best Practices Reference
## Table of Contents
- [Relative Layout Over Constants](#relative-layout-over-constants)
- [Context-Agnostic Views](#context-agnostic-views)
- [Own Your Container](#own-your-container)
- [Layout Performance](#layout-performance)
- [View Logic and Testability](#view-logic-and-... | openai-build-week | .agents/skills/swiftui-expert-skill/references/layout-best-practices.md | Markdown | d00e712d7a5471b4dbd1eed27cb2793865fe0f8e57ff1d1c1afec58920c59aae | 0 | 896 |
Keep Business Logic in Services and Models
**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.
> **iOS 17+**: Use `@Observable`... | openai-build-week | .agents/skills/swiftui-expert-skill/references/layout-best-practices.md | Markdown | f6b74a7762305e47b387655e418cc9b5149fca04f178c30739f01f64abe7d057 | 1 | 681 |
# SwiftUI Liquid Glass Reference (iOS 26+)
## Table of Contents
- [Overview](#overview)
- [Availability](#availability)
- [Core APIs](#core-apis)
- [GlassEffectContainer](#glasseffectcontainer)
- [Glass Button Styles](#glass-button-styles)
- [Morphing Transitions](#morphing-transitions)
- [Modifier Order](#modifier-o... | openai-build-week | .agents/skills/swiftui-expert-skill/references/liquid-glass.md | Markdown | d6e61781c3ff99b535d455863f2f375287f97772c2c02e73b0b4c7dce8fee89d | 0 | 896 |
"eraser")
GlassChip(icon: "trash")
}
}
```
**Note**: The container's `spacing` parameter should match the actual spacing in your layout for proper glass effect rendering.
> Source: "Build a SwiftUI app with the new design" (WWDC25, session 323)
## Glass Button Styles
Built-in button styles for glass app... | openai-build-week | .agents/skills/swiftui-expert-skill/references/liquid-glass.md | Markdown | d11f30989dffdde18103c4c276c2e22db654449126e2b4bb66cf416b8a5bf9ae | 1 | 896 |
var selection: Int
let options: [String]
@Namespace private var animation
var body: some View {
if #available(iOS 26, *) {
GlassEffectContainer(spacing: 4) {
HStack(spacing: 4) {
ForEach(options.indices, id: \.self) { index in
... | openai-build-week | .agents/skills/swiftui-expert-skill/references/liquid-glass.md | Markdown | 7bca07bbd8f04181d2d8ae221ee655b16817fdaa1bff3f59a90fec6bdb998e3c | 2 | 843 |
# SwiftUI List Patterns Reference
## Table of Contents
- [ForEach Identity and Stability](#foreach-identity-and-stability)
- [Enumerated Sequences](#enumerated-sequences)
- [List with Custom Styling](#list-with-custom-styling)
- [List with Pull-to-Refresh](#list-with-pull-to-refresh)
- [Empty States with ContentUnava... | openai-build-week | .agents/skills/swiftui-expert-skill/references/list-patterns.md | Markdown | deaa99f27fdafedbc8b56600a83183e4a301859480bb1a43e36a4b3f847db277 | 0 | 896 |
's body just to compute ids. That cost scales with the number of rows.
The fix is to wrap branching content in any single-root container (`VStack`, `HStack`, `ZStack`, or a custom wrapper) so the row is always exactly one top-level view, as shown above. A top-level `if` without an `else` is also "multi" (0 or 1 views)... | openai-build-week | .agents/skills/swiftui-expert-skill/references/list-patterns.md | Markdown | cd36737dc9b94fe03c87a22fae1a0d5ce8309ef2ecc1db031a99fe057b2806db | 1 | 896 |
direct form in new code — it avoids an eager copy on every body evaluation.
## List with Custom Styling
```swift
// Remove default background and separators
List(items) { item in
ItemRow(item: item)
.listRowInsets(EdgeInsets(top: 8, leading: 16, bottom: 8, trailing: 16))
.listRowSeparator(.hidden)... | openai-build-week | .agents/skills/swiftui-expert-skill/references/list-patterns.md | Markdown | 2ae6399fbec714917c9e4f3ffe45300c154ed8aed6647e79b431b2f457ae7d69 | 2 | 896 |
)
}
.onChange(of: sortOrder) { _, newOrder in
people.sort(using: newOrder)
}
}
}
```
**Important:** The table does **not** sort data itself — you must re-sort the collection when `sortOrder` changes.
### Adaptive Table for Compact Size Classes
On iPhone or iPad in Slide Over, ... | openai-build-week | .agents/skills/swiftui-expert-skill/references/list-patterns.md | Markdown | 13b60d6426126141bfbdeafe00ebe0d8b7a3a8c0963b1c9b117a2d7dcc142f8d | 3 | 896 |
|
|----------|----------|
| **iPadOS (regular)** | Full multi-column layout; headers and all columns visible |
| **iPadOS (compact)** | Only the first column shown; headers hidden |
| **iPhone (all sizes)** | Only the first column shown; headers hidden; list-like appearance |
> **Best Practice:** Prefer handling the c... | openai-build-week | .agents/skills/swiftui-expert-skill/references/list-patterns.md | Markdown | 521e8a0c8a6c5aecdec72de68e74990d72f09004eeb62a362558de249749c6df | 4 | 391 |
# SwiftUI Localization Reference
Guidance for user-facing text: `Text`, `Button`, `Label`, navigation/toolbar titles, alerts, and types that carry localizable strings. For the narrower "verbatim vs localized" decision on a single `Text`, see `references/text-patterns.md`.
## Table of Contents
- [SwiftUI Localizes St... | openai-build-week | .agents/skills/swiftui-expert-skill/references/localization.md | Markdown | 0c51d1da94f3c67efb0b2727975ac78ab61d5870c2823b39a0aef818ba0800f9 | 0 | 896 |
value, so nothing lands in the catalog. To localize a value chosen from a known set, model it with a type that exposes `LocalizedStringResource`:
```swift
enum Category {
case appetizers, mains, desserts
var name: LocalizedStringResource {
switch self {
case .appetizers: "Appetizers"
ca... | openai-build-week | .agents/skills/swiftui-expert-skill/references/localization.md | Markdown | 483dc9c04e6780f5d44b1995d7683a5d4c4d6047aec972edaa6862eeb8dcc2b0 | 1 | 896 |
`dateFormat`.
## Layout for Localization
- Use `.leading` / `.trailing` instead of `.left` / `.right` — they flip for right-to-left locales.
- Don't hardcode frame widths/heights for text; translations vary in length and scripts vary in height. Use `ViewThatFits` when a layout might not fit longer translations.
- Use... | openai-build-week | .agents/skills/swiftui-expert-skill/references/localization.md | Markdown | b2b6cb78a62a8a07f08ce0c17f008b38875bf03650bdf05d6801b78c0b4af5ed | 2 | 681 |
# macOS Scenes Reference
> SwiftUI scene types for macOS apps — `Settings`, `MenuBarExtra`, `WindowGroup`, `Window`, `UtilityWindow`, and `DocumentGroup`. Covers macOS-only scenes and cross-platform scenes with macOS-specific behavior.
## Table of Contents
- [Quick Lookup Table](#quick-lookup-table)
- [Settings (mac... | openai-build-week | .agents/skills/swiftui-expert-skill/references/macos-scenes.md | Markdown | bb91e862dd1998636f8ba0dcc831c8471c30e90a0c4489e2965f69f134eecb99 | 0 | 896 |
: "chart.bar") {
DashboardView()
.frame(width: 240)
}
.menuBarExtraStyle(.window)
```
**Variations:**
- **Toggleable** — pass `isInserted:` with an `@AppStorage` binding to let users show/hide the extra: `MenuBarExtra("Status", systemImage: "chart.bar", isInserted: $showMenuBarExtra)`
- **Menu-bar-only app... | openai-build-week | .agents/skills/swiftui-expert-skill/references/macos-scenes.md | Markdown | e6467dc5d6dccae221dae5ce6de4a57d91d7b188259056f07cf30d6dc43fc7db | 1 | 896 |
and place a `WindowVisibilityToggle` elsewhere in your commands.
---
## DocumentGroup
Document-based apps with automatic file management. On macOS, provides:
- **Document-based menu bar commands** (File > New, Open, Save, Revert)
- **Multiple document windows** simultaneously
- On iOS, shows a document browser inste... | openai-build-week | .agents/skills/swiftui-expert-skill/references/macos-scenes.md | Markdown | ee07cd25932ad8bbd2a358f67440db4f4c5e031b0ae5737f91a11a362af47db8 | 2 | 494 |
# macOS Views & Components Reference
> macOS-specific SwiftUI views, file operations, drag & drop, and AppKit interop. Covers `HSplitView`, `VSplitView`, `Table`, `PasteButton`, file dialogs, cross-app drag & drop, and `NSViewRepresentable`.
## Table of Contents
- [Quick Lookup Table](#quick-lookup-table)
- [HSplitV... | openai-build-week | .agents/skills/swiftui-expert-skill/references/macos-views.md | Markdown | 4634c16c6ef057774acbb10864ddc63c23014d37a3aac537ff3d596256e8efc8 | 0 | 896 |
(macOS-only)
Resizable split layouts with user-draggable dividers. Use for IDE-style panes where all panels are equal peers. `VSplitView` works identically but splits vertically (use `minHeight` instead).
```swift
HSplitView {
FileTreeView()
.frame(minWidth: 200)
CodeEditorView()
.frame(minWid... | openai-build-week | .agents/skills/swiftui-expert-skill/references/macos-views.md | Markdown | 4533251e74df59a008c7dad4977e113c26b4533bc332d47335f303d1c1fa70d0 | 1 | 896 |
to Finder, Mail, or other apps).
### Modern approach (Transferable)
```swift
// Drag source
struct DraggableCard: View {
let item: MyItem
var body: some View {
Text(item.title)
.draggable(item) // Requires Transferable conformance
}
}
// Drop target
struct DropZone: View {
@Stat... | openai-build-week | .agents/skills/swiftui-expert-skill/references/macos-views.md | Markdown | 6ca15a58cf4522979f4259c1e39a758627c7cddbccd78fd566d90fee094804ae | 2 | 855 |
# macOS Window & Toolbar Styling Reference
> Window configuration, toolbar styles, sizing, positioning, and navigation patterns specific to macOS SwiftUI apps.
## Table of Contents
- [Quick Lookup Table](#quick-lookup-table)
- [Toolbar Styles](#toolbar-styles)
- [Window Style](#window-style)
- [Window Sizing](#windo... | openai-build-week | .agents/skills/swiftui-expert-skill/references/macos-window-styling.md | Markdown | fa5fa04ac194d1704e6693b62796a631051115f1dfe173d6ad8521b3f7cfb0f8 | 0 | 896 |
hiddenTitleBar` is useful for media players, custom-chrome apps, or immersive experiences where the standard title bar is unwanted.
---
## Window Sizing
### windowResizability, defaultSize, defaultPosition
These modifiers work together to configure window sizing and placement:
```swift
WindowGroup {
ContentVie... | openai-build-week | .agents/skills/swiftui-expert-skill/references/macos-window-styling.md | Markdown | 63da9faddc884882b4bff7bcc5807d2b57d60b2838894198f16f170bc0df7852 | 1 | 896 |
: [.command, .shift])
}
CommandGroup(after: .newItem) {
Button("New From Template...") { /* ... */ }
}
}
```
**`CommandGroup` placement options:** `.replacing(_:)` replaces a system group, `.before(_:)` / `.after(_:)` inserts adjacent to it. Common placements: `.newItem`, `.saveItem`, `.help`, `.to... | openai-build-week | .agents/skills/swiftui-expert-skill/references/macos-window-styling.md | Markdown | 81bfeacb88b6e25802e3279dfe1d320e555af09a7a90c2932627b352cde82ab5 | 2 | 443 |
# SwiftUI Performance Patterns Reference
## Table of Contents
- [Performance Optimization](#performance-optimization)
- [Anti-Patterns](#anti-patterns)
- [Summary Checklist](#summary-checklist)
## Performance Optimization
### 1. Avoid Redundant State Updates
SwiftUI doesn't compare values before triggering updates... | openai-build-week | .agents/skills/swiftui-expert-skill/references/performance-patterns.md | Markdown | b713806342b3239fa731feab207dc69bc7009fefa8cd1f1becfb06b88d33127d | 0 | 896 |
{
ForEach(items) { item in
ExpensiveRow(item: item)
}
}
}
```
**iOS 26+ note**: Nested scroll views containing lazy stacks now automatically defer loading their children until they are about to appear, matching the behavior of top-level lazy stacks. This benefits patterns like horizonta... | openai-build-week | .agents/skills/swiftui-expert-skill/references/performance-patterns.md | Markdown | da8967209735aa4af94963650bc47766ad79c955559ff4a688bbf247d263f71a | 1 | 896 |
speed — see item #10 below.
For purely visual effects driven by scroll position (opacity, scale, rotation), prefer `scrollTransition` or `visualEffect(in:)` — they push the per-frame work to the renderer and skip body re-evaluation entirely. Reach for the `@Observable` + coarsening pattern only when the scroll-derived... | openai-build-week | .agents/skills/swiftui-expert-skill/references/performance-patterns.md | Markdown | 513b51eb40987aac889ba8a888c3a8dd2814f2773860c63e582b4f25d30b6903 | 2 | 896 |
swift
// BAD - sorts array every body call
var body: some View {
List(items.sorted { $0.name < $1.name }) { item in Text(item.name) }
}
// GOOD - compute once, update via onChange or a computed property in the model
@State private var sortedItems: [Item] = []
var body: some View {
List(sortedItems) { item in ... | openai-build-week | .agents/skills/swiftui-expert-skill/references/performance-patterns.md | Markdown | c84d60ab0075ea0e40040212a2344f4648f20242a68a9da056ef719befbadf74 | 3 | 426 |
# SwiftUI Previews Reference
## Table of Contents
- [Preview Macro](#preview-macro)
- [Preview with Mock Data](#preview-with-mock-data)
- [@Previewable Property Wrappers](#previewable-property-wrappers)
- [Common Diagnostics](#common-diagnostics)
- [Summary Checklist](#summary-checklist)
---
## Preview Macro
The `... | openai-build-week | .agents/skills/swiftui-expert-skill/references/previews.md | Markdown | d219bc869048f1435d1b50e0f04a1fd413fca667dcf8175d88100369a1fad948 | 0 | 896 |
## Preview with Environment Dependencies
Inject any environment values the view depends on so the preview reflects a realistic runtime context:
```swift
#Preview {
OrderDetailView(order: .sample)
.environment(CartModel.preview)
.environment(\.locale, Locale(identifier: "ja_JP"))
.environme... | openai-build-week | .agents/skills/swiftui-expert-skill/references/previews.md | Markdown | db31a53da3c0d0184ccbe60e19efec33caa4114fa07dfa2644411a9ed7cc28a3 | 1 | 896 |
view, or gate with `#available` |
| Preview crashes with "missing environment" | An `@Environment(SomeType.self)` value is not injected | Add `.environment(SomeType.preview)` to the preview |
| Preview hangs or renders blank | View depends on async data that never resolves | Inject a mock that returns immediately with ... | openai-build-week | .agents/skills/swiftui-expert-skill/references/previews.md | Markdown | 4f820e4ce7eba33dd7aadd3603e06ebb1e3aa1a6e45879ae49e5bf60bd674070 | 2 | 263 |
# SwiftUI ScrollView Patterns Reference
## Table of Contents
- [ScrollViewReader for Programmatic Scrolling](#scrollviewreader-for-programmatic-scrolling)
- [Scroll Position Tracking](#scroll-position-tracking)
- [Scroll Transitions and Effects](#scroll-transitions-and-effects)
- [Scroll Target Behavior](#scroll-targ... | openai-build-week | .agents/skills/swiftui-expert-skill/references/scroll-patterns.md | Markdown | 247161dbce7a5f8279a42a4c5671b36c1a8efbbf93ddc2842c9e8c302d8b7ce3 | 0 | 896 |
) { offset in
if offset < -50 { // Scrolling down
withAnimation { showHeader = false }
} else if offset > 50 { // Scrolling up
withAnimation { showHeader = true }
}
}
}
}
}
```
## Scroll Transitions and Effects... | openai-build-week | .agents/skills/swiftui-expert-skill/references/scroll-patterns.md | Markdown | b64b9eb66b5b868ed9b9d01c80454b1792179da06bd95d522f7c37b911b078ce | 1 | 547 |
# SwiftUI Sheet, Navigation & Inspector Patterns Reference
## Table of Contents
- [Sheet Patterns](#sheet-patterns)
- [Navigation Patterns](#navigation-patterns)
- [Multi-Column Navigation with NavigationSplitView](#multi-column-navigation-with-navigationsplitview)
- [Inspector](#inspector)
- [Presentation Modifiers]... | openai-build-week | .agents/skills/swiftui-expert-skill/references/sheet-navigation-patterns.md | Markdown | 69ca979d03e9d614b11dfc64204e06ad1614879783fc7589941870078b0e6899 | 0 | 896 |
}
```
### Programmatic Navigation
```swift
struct ContentView: View {
@State private var navigationPath = NavigationPath()
var body: some View {
NavigationStack(path: $navigationPath) {
List {
Button("Go to Detail") {
navigationPath.append(DetailRou... | openai-build-week | .agents/skills/swiftui-expert-skill/references/sheet-navigation-patterns.md | Markdown | de8ec0f8d21c9faeb622dc2d0969e0e2b2ce8c202a9976060ab6961704075c05 | 1 | 896 |
## Inspector with Column Width
```swift
MyEditorView()
.inspector(isPresented: $showInspector) {
InspectorContent()
.inspectorColumnWidth(min: 200, ideal: 250, max: 400)
}
```
### Inspector with Fixed Width
```swift
MyEditorView()
.inspector(isPresented: $showInspector) {
Insp... | openai-build-week | .agents/skills/swiftui-expert-skill/references/sheet-navigation-patterns.md | Markdown | c217c560f50eae4f73d621bddc998fa671566c8ca8ca6e40cc9f20337351229b | 2 | 584 |
# Handling Soft-Deprecated APIs
This file covers *how to behave* when you encounter soft-deprecated SwiftUI APIs. For the actual list of deprecated-to-modern transitions, see `references/latest-apis.md`.
## What "soft-deprecated" means
A soft-deprecated API is marked deprecated in the SDK headers but with a placehol... | openai-build-week | .agents/skills/swiftui-expert-skill/references/soft-deprecation.md | Markdown | ac907d3729e75747c6b19e9cc6a911337c05b8ff1c25695495ce7cda9d2f5548 | 0 | 653 |
# SwiftUI State Management Reference
## Table of Contents
- [Property Wrapper Selection Guide](#property-wrapper-selection-guide)
- [@State](#state)
- [Property Wrappers Inside @Observable Classes](#property-wrappers-inside-observable-classes)
- [Make @Observable Property Types Equatable](#make-observable-property-ty... | openai-build-week | .agents/skills/swiftui-expert-skill/references/state-management.md | Markdown | b6177fedb8bfda6ca0071a78e5e7a22799813a9d54b225ea61b6859e6a54c396 | 0 | 896 |
state. `@State` tells SwiftUI to preserve the instance across view redraws. Using `@State` also provides bindings directly (no need for `@Bindable`).
**Note**: You may want to mark `@Observable` classes with `@MainActor` to ensure thread safety with SwiftUI, unless your project or package uses Default Actor Isolation ... | openai-build-week | .agents/skills/swiftui-expert-skill/references/state-management.md | Markdown | 0ab755ee1bf2e0136bf256e4708334777199f295fe55d910740ef9eafa5a4b35 | 1 | 896 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.