update-swiftui-apis

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Update SwiftUI APIs

更新SwiftUI API

Systematically scan Apple's developer documentation via the Sosumi MCP, identify deprecated SwiftUI APIs and their modern replacements, and update
swiftui-expert-skill/references/latest-apis.md
.
通过Sosumi MCP系统地扫描Apple开发者文档,识别已弃用的SwiftUI API及其现代替代方案,并更新
swiftui-expert-skill/references/latest-apis.md
文件。

Prerequisites

前提条件

  • Sosumi MCP must be enabled and available (provides
    searchAppleDocumentation
    ,
    fetchAppleDocumentation
    ,
    fetchAppleVideoTranscript
    ,
    fetchExternalDocumentation
    )
  • Write access to this repository (or a fork)
  • Sosumi MCP必须已启用且可用(提供
    searchAppleDocumentation
    fetchAppleDocumentation
    fetchAppleVideoTranscript
    fetchExternalDocumentation
    功能)
  • 拥有此仓库(或其分支)的写入权限

Workflow

工作流程

1. Understand current coverage

1. 了解当前覆盖范围

Read
swiftui-expert-skill/references/latest-apis.md
to understand:
  • Which deprecated-to-modern transitions are already documented
  • The version segments in use (iOS 15+, 16+, 17+, 18+, 26+)
  • The Quick Lookup Table at the bottom
阅读
swiftui-expert-skill/references/latest-apis.md
文件,了解:
  • 哪些“已弃用-现代替代”的转换已被记录
  • 使用的版本分段(iOS 15+、16+、17+、18+、26+)
  • 底部的快速查询表

2. Load the scan manifest

2. 加载扫描清单

Read
references/scan-manifest.md
(relative to this skill). It contains the categorized list of API areas, documentation paths, search queries, and WWDC video paths to scan.
读取本skill下的
references/scan-manifest.md
文件。它包含了待扫描的API领域分类列表、文档路径、搜索查询词以及WWDC视频路径。

3. Scan Apple documentation

3. 扫描Apple文档

For each category in the manifest:
  1. Call
    searchAppleDocumentation
    with the listed queries to discover relevant pages.
  2. Call
    fetchAppleDocumentation
    with specific documentation paths to get full API details.
  3. Look for deprecation notices, "Deprecated" labels, and "Use ... instead" guidance.
  4. Note the iOS version where the modern replacement became available.
  5. Optionally call
    fetchAppleVideoTranscript
    for WWDC sessions that announce API changes.
Batch related searches together for efficiency. Focus on finding new deprecations not yet in
latest-apis.md
.
针对清单中的每个分类:
  1. 使用列出的查询词调用
    searchAppleDocumentation
    以发现相关页面。
  2. 使用特定文档路径调用
    fetchAppleDocumentation
    以获取完整的API详情。
  3. 查找弃用通知、“Deprecated”标签以及“使用...替代”的指引。
  4. 记录现代替代方案开始可用的iOS版本。
  5. (可选)调用
    fetchAppleVideoTranscript
    获取宣布API变更的WWDC会话文字记录。
批量处理相关搜索以提升效率。重点查找
latest-apis.md
中尚未记录的弃用情况。

4. Compare and identify changes

4. 对比并识别变更

Compare findings against existing entries. Categorize results:
  • New deprecations: APIs not yet documented in
    latest-apis.md
  • Corrections: Existing entries that need updating (wrong version, better replacement available)
  • New version segments: If a new iOS version introduces deprecations, add a new section
将发现的内容与现有条目进行对比。对结果进行分类:
  • 新弃用项
    latest-apis.md
    中尚未记录的API
  • 修正项:需要更新的现有条目(版本错误、有更好的替代方案)
  • 新版本分段:如果iOS新版本引入了弃用项,添加新的章节

5. Update latest-apis.md

5. 更新latest-apis.md

Follow the established format exactly. Each entry must include:
Section placement -- place under the correct version segment:
  • "Always Use (iOS 15+)" for long-deprecated APIs
  • "When Targeting iOS 16+" / "17+" / "18+" / "26+" for version-gated changes
Entry format:
markdown
**Always use `modernAPI()` instead of `deprecatedAPI()`.**

\```swift
// Modern
View()
    .modernAPI()

// Deprecated
View()
    .deprecatedAPI()
\```
Quick Lookup Table -- add a row at the bottom of the file:
markdown
| `deprecatedAPI()` | `modernAPI()` | iOS XX+ |
Keep the attribution line at the top of the file:
Based on a comparison of Apple's documentation using the Sosumi MCP, we found the latest recommended APIs to use.
严格遵循既定格式。每个条目必须包含:
章节放置 -- 放在对应的版本分段下:
  • “Always Use (iOS 15+)” 用于长期已弃用的API
  • “When Targeting iOS 16+” / “17+” / “18+” / “26+” 用于版本限制的变更
条目格式:
markdown
**请始终使用`modernAPI()`替代`deprecatedAPI()`**

\```swift
// 现代写法
View()
    .modernAPI()

// 已弃用写法
View()
    .deprecatedAPI()
\```
快速查询表 -- 在文件底部添加一行:
markdown
| `deprecatedAPI()` | `modernAPI()` | iOS XX+ |
保留文件顶部的声明行:
基于使用Sosumi MCP对Apple文档的对比结果,我们整理了推荐使用的最新API。

6. Open a pull request

6. 发起拉取请求

  1. Create a branch from
    main
    named
    update/latest-apis-YYYY-MM
    (use current year and month).
  2. Commit changes to
    swiftui-expert-skill/references/latest-apis.md
    .
  3. Open a PR via
    gh pr create
    with:
    • Title: "Update latest SwiftUI APIs (Month Year)"
    • Body: Summary of new/changed entries, attribution to Sosumi MCP
  1. main
    分支创建一个名为
    update/latest-apis-YYYY-MM
    的分支(使用当前年份和月份)。
  2. 提交对
    swiftui-expert-skill/references/latest-apis.md
    的更改。
  3. 通过
    gh pr create
    发起PR,包含:
    • 标题:“更新最新SwiftUI API(年月)”
    • 正文:新条目/变更条目的摘要,注明使用Sosumi MCP获取信息

Sosumi MCP Tool Reference

Sosumi MCP工具参考

ToolParametersReturns
searchAppleDocumentation
query
(string)
JSON with
results[]
containing
title
,
url
,
description
,
breadcrumbs
,
tags
,
type
fetchAppleDocumentation
path
(string, e.g.
/documentation/swiftui/view/foregroundstyle(_:)
)
Markdown documentation content
fetchAppleVideoTranscript
path
(string, e.g.
/videos/play/wwdc2025/10133
)
Markdown transcript
fetchExternalDocumentation
url
(string, full https URL)
Markdown documentation content
工具参数返回值
searchAppleDocumentation
query
(字符串)
包含
results[]
的JSON,其中每个结果包含
title
url
description
breadcrumbs
tags
type
fetchAppleDocumentation
path
(字符串,例如
/documentation/swiftui/view/foregroundstyle(_:)
Markdown格式的文档内容
fetchAppleVideoTranscript
path
(字符串,例如
/videos/play/wwdc2025/10133
Markdown格式的文字记录
fetchExternalDocumentation
url
(字符串,完整的https链接)
Markdown格式的文档内容

Tips

提示

  • Start broad with
    searchAppleDocumentation
    queries, then drill into specific paths with
    fetchAppleDocumentation
    .
  • Apple's deprecation docs typically say "Deprecated" in the page and link to the replacement.
  • WWDC "What's new in SwiftUI" sessions are the best source for newly introduced replacements.
  • When unsure about the exact iOS version for a deprecation, verify by checking the "Availability" section in the fetched documentation.
  • If an API is deprecated but no direct replacement exists, note this rather than suggesting an incorrect alternative.
  • 先使用
    searchAppleDocumentation
    进行宽泛查询,再使用
    fetchAppleDocumentation
    深入特定路径。
  • Apple的弃用文档通常会在页面中显示“Deprecated”字样,并链接到替代方案。
  • WWDC的“What's new in SwiftUI”会话是了解新引入替代方案的最佳来源。
  • 若不确定弃用对应的具体iOS版本,可通过检查获取到的文档中的“Availability”部分进行验证。
  • 如果某个API已被弃用但没有直接的替代方案,请注明这一点,而非建议不正确的替代方案。