update-swiftui-apis
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUpdate 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.mdPrerequisites
前提条件
- 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 to understand:
swiftui-expert-skill/references/latest-apis.md- 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 (relative to this skill). It contains the categorized list of API areas, documentation paths, search queries, and WWDC video paths to scan.
references/scan-manifest.md读取本skill下的文件。它包含了待扫描的API领域分类列表、文档路径、搜索查询词以及WWDC视频路径。
references/scan-manifest.md3. Scan Apple documentation
3. 扫描Apple文档
For each category in the manifest:
- Call with the listed queries to discover relevant pages.
searchAppleDocumentation - Call with specific documentation paths to get full API details.
fetchAppleDocumentation - Look for deprecation notices, "Deprecated" labels, and "Use ... instead" guidance.
- Note the iOS version where the modern replacement became available.
- Optionally call for WWDC sessions that announce API changes.
fetchAppleVideoTranscript
Batch related searches together for efficiency. Focus on finding new deprecations not yet in .
latest-apis.md针对清单中的每个分类:
- 使用列出的查询词调用以发现相关页面。
searchAppleDocumentation - 使用特定文档路径调用以获取完整的API详情。
fetchAppleDocumentation - 查找弃用通知、“Deprecated”标签以及“使用...替代”的指引。
- 记录现代替代方案开始可用的iOS版本。
- (可选)调用获取宣布API变更的WWDC会话文字记录。
fetchAppleVideoTranscript
批量处理相关搜索以提升效率。重点查找中尚未记录的新弃用情况。
latest-apis.md4. 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
将发现的内容与现有条目进行对比。对结果进行分类:
- 新弃用项:中尚未记录的API
latest-apis.md - 修正项:需要更新的现有条目(版本错误、有更好的替代方案)
- 新版本分段:如果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. 发起拉取请求
- Create a branch from named
main(use current year and month).update/latest-apis-YYYY-MM - Commit changes to .
swiftui-expert-skill/references/latest-apis.md - Open a PR via with:
gh pr create- Title: "Update latest SwiftUI APIs (Month Year)"
- Body: Summary of new/changed entries, attribution to Sosumi MCP
- 从分支创建一个名为
main的分支(使用当前年份和月份)。update/latest-apis-YYYY-MM - 提交对的更改。
swiftui-expert-skill/references/latest-apis.md - 通过发起PR,包含:
gh pr create- 标题:“更新最新SwiftUI API(年月)”
- 正文:新条目/变更条目的摘要,注明使用Sosumi MCP获取信息
Sosumi MCP Tool Reference
Sosumi MCP工具参考
| Tool | Parameters | Returns |
|---|---|---|
| | JSON with |
| | Markdown documentation content |
| | Markdown transcript |
| | Markdown documentation content |
| 工具 | 参数 | 返回值 |
|---|---|---|
| | 包含 |
| | Markdown格式的文档内容 |
| | Markdown格式的文字记录 |
| | Markdown格式的文档内容 |
Tips
提示
- Start broad with queries, then drill into specific paths with
searchAppleDocumentation.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已被弃用但没有直接的替代方案,请注明这一点,而非建议不正确的替代方案。