From 0a770caf84580adfd7aa541e49e5027983366a21 Mon Sep 17 00:00:00 2001 From: Okmin Date: Thu, 19 Feb 2026 12:15:41 +0900 Subject: [PATCH] fix(skills): address code review feedback on iOS 26 skill examples - Add required name/description properties and @Generable to RecipeSearchTool - Fix missing argument label in session.respond(to:) call - Remove non-existent .scrollExtensionMode API, replace with correct guidance - Change PhotoProcessor from struct to class for cache mutation support - Fix method name mismatch in @concurrent example caller --- skills/foundation-models-on-device/SKILL.md | 8 ++++++-- skills/liquid-glass-design/SKILL.md | 8 ++------ skills/swift-concurrency-6-2/SKILL.md | 7 ++++--- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/skills/foundation-models-on-device/SKILL.md b/skills/foundation-models-on-device/SKILL.md index 365bd747..074598f0 100644 --- a/skills/foundation-models-on-device/SKILL.md +++ b/skills/foundation-models-on-device/SKILL.md @@ -113,7 +113,11 @@ Let the model invoke custom code for domain-specific tasks: ```swift struct RecipeSearchTool: Tool { - struct Arguments: Codable { + let name = "recipe_search" + let description = "Search for recipes matching a given term and return a list of results." + + @Generable + struct Arguments { var searchTerm: String var numberOfResults: Int } @@ -139,7 +143,7 @@ let response = try await session.respond(to: "Find me some pasta recipes") ```swift do { - let answer = try await session.respond("Find a recipe for tomato soup.") + let answer = try await session.respond(to: "Find a recipe for tomato soup.") } catch let error as LanguageModelSession.ToolCallError { print(error.tool.name) if case .databaseIsEmpty = error.underlyingError as? RecipeSearchToolError { diff --git a/skills/liquid-glass-design/SKILL.md b/skills/liquid-glass-design/SKILL.md index bf068910..03a49b40 100644 --- a/skills/liquid-glass-design/SKILL.md +++ b/skills/liquid-glass-design/SKILL.md @@ -124,13 +124,9 @@ Button("Toggle") { .buttonStyle(.glass) ``` -### Scroll and Sidebar Extensions +### Extending Horizontal Scrolling Under Sidebar -```swift -// Extend horizontal scroll under sidebar -ScrollView(.horizontal) { /* content */ } - .scrollExtensionMode(.underSidebar) -``` +To allow horizontal scroll content to extend under a sidebar or inspector, ensure the `ScrollView` content reaches the leading/trailing edges of the container. The system automatically handles the under-sidebar scrolling behavior when the layout extends to the edges — no additional modifier is needed. ## Core Pattern — UIKit diff --git a/skills/swift-concurrency-6-2/SKILL.md b/skills/swift-concurrency-6-2/SKILL.md index 7def68b2..7e79839b 100644 --- a/skills/swift-concurrency-6-2/SKILL.md +++ b/skills/swift-concurrency-6-2/SKILL.md @@ -137,8 +137,8 @@ This mode is opt-in and recommended for apps, scripts, and other executable targ When you need actual parallelism, explicitly offload with `@concurrent`: ```swift -nonisolated struct PhotoProcessor { - var cachedStickers: [String: Sticker] +nonisolated final class PhotoProcessor { + private var cachedStickers: [String: Sticker] = [:] func extractSticker(data: Data, with id: String) async -> Sticker { if let sticker = cachedStickers[id] { @@ -156,7 +156,8 @@ nonisolated struct PhotoProcessor { } // Callers must await -processedPhotos[item.id] = await PhotoProcessor().process(data: data) +let processor = PhotoProcessor() +processedPhotos[item.id] = await processor.extractSticker(data: data, with: item.id) ``` To use `@concurrent`: