fix(skills): improve code examples in iOS 26 skills

- Add do-catch error handling to SwiftUI streaming example in
  foundation-models-on-device
- Add Auto Layout constraints to UIKit glass effect example in
  liquid-glass-design
- Promote build settings prerequisite from code comment to visible
  blockquote warning in swift-concurrency-6-2
This commit is contained in:
Okmin
2026-02-24 14:39:25 +09:00
parent 1e79991407
commit 300b6715f9
3 changed files with 27 additions and 6 deletions

View File

@@ -136,10 +136,9 @@ This mode is opt-in and recommended for apps, scripts, and other executable targ
When you need actual parallelism, explicitly offload with `@concurrent`:
> **Important:** This example requires Approachable Concurrency build settings — SE-0466 (MainActor default isolation) and SE-0461 (NonisolatedNonsendingByDefault). With these enabled, `extractSticker` stays on the caller's actor, making mutable state access safe. **Without these settings, this code has a data race** — the compiler will flag it.
```swift
// Assumes Approachable Concurrency build settings are enabled:
// SE-0466 (MainActor default isolation) and SE-0461 (NonisolatedNonsendingByDefault).
// Safe mutation of cachedStickers via await depends on these compiler options.
nonisolated final class PhotoProcessor {
private var cachedStickers: [String: Sticker] = [:]