mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-17 23:53:30 +08:00
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:
@@ -178,6 +178,7 @@ for try await partial in stream {
|
||||
|
||||
```swift
|
||||
@State private var partialResult: TripIdeas.PartiallyGenerated?
|
||||
@State private var errorMessage: String?
|
||||
|
||||
var body: some View {
|
||||
List {
|
||||
@@ -185,10 +186,17 @@ var body: some View {
|
||||
Text(idea)
|
||||
}
|
||||
}
|
||||
.overlay {
|
||||
if let errorMessage { Text(errorMessage).foregroundStyle(.red) }
|
||||
}
|
||||
.task {
|
||||
let stream = session.streamResponse(to: prompt, generating: TripIdeas.self)
|
||||
for try await partial in stream {
|
||||
partialResult = partial
|
||||
do {
|
||||
let stream = session.streamResponse(to: prompt, generating: TripIdeas.self)
|
||||
for try await partial in stream {
|
||||
partialResult = partial
|
||||
}
|
||||
} catch {
|
||||
errorMessage = error.localizedDescription
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user