swiftui
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSwiftUI Reference
SwiftUI 参考
This skill provides access to SwiftUI documentation via downloaded reference files and the sosumi.ai technique for fetching additional Apple docs.
本技能通过已下载的参考文件以及用于获取更多Apple文档的sosumi.ai技术,为你提供SwiftUI文档访问能力。
Downloaded Reference Files
已下载的参考文件
The following Apple documentation pages are available locally (grep-friendly):
| File | Content |
|---|---|
| swiftui-overview.md | Full SwiftUI framework index (907KB) |
| view-protocol.md | View protocol and all modifiers (59KB) |
| state.md | @State property wrapper |
| binding.md | @Binding property wrapper |
| environment.md | @Environment property wrapper |
| observation.md | @Observable macro (iOS 17+) |
| navigationstack.md | NavigationStack (iOS 16+) |
| navigationsplitview.md | NavigationSplitView |
| tabview.md | TabView |
| list.md | List view |
以下Apple文档页面可本地访问(支持grep搜索):
| 文件 | 内容 |
|---|---|
| swiftui-overview.md | 完整SwiftUI框架索引(907KB) |
| view-protocol.md | View协议及所有修饰符(59KB) |
| state.md | @State属性包装器 |
| binding.md | @Binding属性包装器 |
| environment.md | @Environment属性包装器 |
| observation.md | @Observable宏(iOS 17+) |
| navigationstack.md | NavigationStack(iOS 16+) |
| navigationsplitview.md | NavigationSplitView |
| tabview.md | TabView |
| list.md | List视图 |
Fetching Additional Documentation
获取更多文档
The sosumi.ai Technique
sosumi.ai 技术
Apple's developer.apple.com uses JavaScript rendering, making it inaccessible to WebFetch. Replace with to get LLM-friendly markdown:
developer.apple.comsosumi.aiundefinedApple的developer.apple.com采用JavaScript渲染,WebFetch无法直接访问。将替换为即可获得适配LLM的markdown格式内容:
developer.apple.comsosumi.aiundefinedOriginal (doesn't work)
原始链接(无法正常访问)
LLM-friendly
适配LLM的链接
Downloading Docs via curl
使用curl下载文档
To download any Apple documentation page:
bash
curl -sL "https://sosumi.ai/documentation/swiftui/[topic]" > [topic].md如需下载任意Apple文档页面:
bash
curl -sL "https://sosumi.ai/documentation/swiftui/[topic]" > [topic].mdExamples:
示例:
curl -sL "https://sosumi.ai/documentation/swiftui/text" > text.md
curl -sL "https://sosumi.ai/documentation/swiftui/button" > button.md
curl -sL "https://sosumi.ai/documentation/swiftui/sheet" > sheet.md
undefinedcurl -sL "https://sosumi.ai/documentation/swiftui/text" > text.md
curl -sL "https://sosumi.ai/documentation/swiftui/button" > button.md
curl -sL "https://sosumi.ai/documentation/swiftui/sheet" > sheet.md
undefinedCommon SwiftUI Doc Paths
常用SwiftUI文档路径
| Topic | URL Path |
|---|---|
| Text | |
| Button | |
| Image | |
| VStack | |
| HStack | |
| ZStack | |
| Form | |
| Sheet | |
| Alert | |
| Picker | |
| Toggle | |
| Slider | |
| ProgressView | |
| AsyncImage | |
| GeometryReader | |
| ScrollView | |
| LazyVStack | |
| LazyHStack | |
| NavigationLink | |
| ToolbarItem | |
| 主题 | URL路径 |
|---|---|
| Text | |
| Button | |
| Image | |
| VStack | |
| HStack | |
| ZStack | |
| Form | |
| Sheet | |
| Alert | |
| Picker | |
| Toggle | |
| Slider | |
| ProgressView | |
| AsyncImage | |
| GeometryReader | |
| ScrollView | |
| LazyVStack | |
| LazyHStack | |
| NavigationLink | |
| ToolbarItem | |
Beyond SwiftUI
适配其他Apple框架
The same technique works for all Apple frameworks:
bash
undefined同样的技术适用于所有Apple框架:
bash
undefinedHealthKit
HealthKit
curl -sL "https://sosumi.ai/documentation/healthkit"
curl -sL "https://sosumi.ai/documentation/healthkit"
Core Data
Core Data
curl -sL "https://sosumi.ai/documentation/coredata"
curl -sL "https://sosumi.ai/documentation/coredata"
UIKit
UIKit
curl -sL "https://sosumi.ai/documentation/uikit"
curl -sL "https://sosumi.ai/documentation/uikit"
Foundation
Foundation
curl -sL "https://sosumi.ai/documentation/foundation"
curl -sL "https://sosumi.ai/documentation/foundation"
Combine
Combine
curl -sL "https://sosumi.ai/documentation/combine"
curl -sL "https://sosumi.ai/documentation/combine"
SwiftData
SwiftData
curl -sL "https://sosumi.ai/documentation/swiftdata"
undefinedcurl -sL "https://sosumi.ai/documentation/swiftdata"
undefinedUsage Instructions
使用说明
- Check downloaded files first - Grep the local files for your topic
.md - Download if missing - Use curl to fetch specific documentation
- Use WebFetch for quick lookups - For single questions where a summary suffices
Example workflow:
bash
undefined- 优先检查已下载文件 - 对本地文件执行grep搜索查找所需主题
.md - 缺失时下载 - 使用curl获取特定文档
- 快速查询使用WebFetch - 适用于仅需摘要的单个问题
示例工作流:
bash
undefinedLooking for info on modifiers?
查找修饰符相关信息?
grep -i "padding" view-protocol.md
grep -i "padding" view-protocol.md
Need full Text documentation?
需要完整的Text文档?
curl -sL "https://sosumi.ai/documentation/swiftui/text" > text.md
curl -sL "https://sosumi.ai/documentation/swiftui/text" > text.md
Quick lookup via WebFetch
通过WebFetch快速查询
WebFetch("https://sosumi.ai/documentation/swiftui/text", "How to style Text?")
undefinedWebFetch("https://sosumi.ai/documentation/swiftui/text", "How to style Text?")
undefinedSources
来源
- SwiftUI | Apple Developer Documentation
- sosumi.ai - Community tool for LLM-friendly Apple docs
- SwiftUI | Apple 开发者文档
- sosumi.ai - 提供适配LLM的Apple文档的社区工具