重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
swift-networking by johnrogers/claude-swift-engineering
npx skills add https://github.com/johnrogers/claude-swift-engineering --skill swift-networkingNetwork.framework 是苹果推出的现代网络 API,用于 TCP/UDP 连接,它通过智能连接建立、用户空间网络和无缝移动性处理取代了传统的 BSD 套接字。
只要内容有被需要的可能,无论多小,都应加载参考资料。 拥有上下文总比错过某个模式或犯错误要好。
| 参考资料 | 加载时机 |
|---|---|
| 入门指南 | 为 TCP/UDP 设置 NWConnection,在 API 之间进行选择 |
| 连接状态 | 处理 .waiting、.ready、.failed 状态转换 |
| iOS 26+ 网络编程 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| 使用 NetworkConnection 配合 async/await、TLV 帧结构、Coder 协议 |
| 迁移指南 | 从套接字、CFSocket、SCNetworkReachability、URLSession 迁移 |
| 故障排除 | 调试超时、TLS 失败、连接问题 |
忽略状态处理器 — 创建 NWConnection 时不设置状态变更处理器意味着你永远无法知道它何时就绪或失败。务必首先实现状态处理器。
阻塞主线程 — 切勿在主队列上调用 receive()。所有网络操作都应使用后台 DispatchQueue 或 Task。
选择错误的队列 — 使用错误的队列(UI 队列处理网络工作,或串行队列处理并发读取)会导致死锁或静默失败。务必明确指定你的队列选择。
不处理网络切换 — WiFi/蜂窝网络切换或网络丢失并非总能被自动检测到。为实现健壮的应用程序,请实施可用性检查和状态监控。
错误恢复不当 — 网络错误需要带有退避机制的重试逻辑。在瞬时错误(超时、临时丢失)上立即失败会带来糟糕的用户体验。
每周安装量
51
代码仓库
GitHub 星标数
179
首次出现
2026年1月23日
安全审计
安装于
opencode40
codex40
claude-code40
gemini-cli35
cursor34
github-copilot32
Network.framework is Apple's modern networking API for TCP/UDP connections, replacing BSD sockets with smart connection establishment, user-space networking, and seamless mobility handling.
ALWAYS load reference files if there is even a small chance the content may be required. It's better to have the context than to miss a pattern or make a mistake.
| Reference | Load When |
|---|---|
| Getting Started | Setting up NWConnection for TCP/UDP, choosing between APIs |
| Connection States | Handling .waiting, .ready, .failed transitions |
| iOS 26+ Networking | Using NetworkConnection with async/await, TLV framing, Coder protocol |
| Migration Guide | Moving from sockets, CFSocket, SCNetworkReachability, URLSession |
| Troubleshooting | Debugging timeouts, TLS failures, connection issues |
Ignoring state handlers — Creating an NWConnection without a state change handler means you never learn when it's ready or failed. Always implement the state handler first.
Blocking the main thread — Never call receive() on the main queue. Use a background DispatchQueue or Task for all network operations.
Wrong queue selection — Using the wrong queue (UI queue for network work, or serial queue for concurrent reads) causes deadlocks or silent failures. Always explicit your queue choice.
Not handling network transitions — WiFi/cellular switches or network loss aren't always detected automatically. Implement viability checks and state monitoring for robust apps.
Improper error recovery — Network errors need retry logic with backoff. Immediately failing on transient errors (timeouts, temporary loss) creates poor UX.
Weekly Installs
51
Repository
GitHub Stars
179
First Seen
Jan 23, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode40
codex40
claude-code40
gemini-cli35
cursor34
github-copilot32
API模糊测试漏洞赏金指南:REST、SOAP、GraphQL安全测试与IDOR绕过技术
208 周安装
macOS应用设计开发指南:原生体验、UI规范与最佳实践
205 周安装
NeuroKit2:Python生理信号处理工具包,用于ECG、EEG、EDA、EMG分析
205 周安装
Nansen Trading 命令行工具:Solana 和 Base 链上代币交易与报价执行指南
207 周安装
NuxtJS Vue TypeScript 开发指南:Vue 3 组合式 API、TypeScript 与性能优化最佳实践
206 周安装
Nansen智能提醒CLI工具:区块链链上监控与聪明钱追踪
207 周安装