重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
ios-expert by oimiragieo/agent-studio
npx skills add https://github.com/oimiragieo/agent-studio --skill ios-expert在审查或编写代码时,请遵循以下准则:
在审查或编写代码时,请遵循以下准则:
在审查或编写代码时,请遵循以下准则:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
.animation() 修饰符实现平滑过渡的动画来增强 UI。@MainActor 进行 UI 更新 —— SwiftUI 和 UIKit 视图必须在主线程上修改;后台线程的 UI 更新会导致运行时崩溃或无声的视觉损坏。@State —— @State 是视图局部的,不会将更改传播到兄弟视图或父视图;对于共享模型数据,请使用 @ObservedObject、@EnvironmentObject 或 @StateObject。self 的闭包中使用 [weak self] 实现正确的内存管理 —— 在被捕获对象持有的闭包中强捕获 self 会导致循环引用和内存泄漏。const 构造函数并将 SwiftUI 视图标记为 struct —— 基于类的 SwiftUI 视图会失去自动差异化优化;结构体视图支持高效的身份跟踪。| 反模式 | 失败原因 | 正确方法 |
|---|---|---|
| 从后台线程更新 UI | UIKit/SwiftUI 不是线程安全的;会导致随机崩溃、视觉损坏或静默失败 | 调度到主线程:DispatchQueue.main.async 或使用 @MainActor 注解的函数 |
对共享模型数据使用 @State | State 是视图私有的;兄弟视图看不到更改;导致 UI 不一致 | 对模型使用 @StateObject + @ObservableObject;通过 @ObservedObject 传递 |
| 在异步闭包中强捕获 self | 循环引用阻止释放;内存无限增长 | 在所有超出当前作用域持有的闭包中使用 [weak self] |
| 同步网络调用 | 阻塞主线程;触发 ANR/看门狗;UI 冻结 | 使用 async/await 配合 URLSession.data(for:) 或 Combine;始终在后台进行 |
| 基于类的 SwiftUI 视图 | 放弃了结构体差异化优化;渲染速度慢;生命周期问题 | 将所有视图定义为 struct;仅对 ObservableObject 模型使用 class |
此专家技能整合了 1 项独立技能:
开始前:
cat .claude/context/memory/learnings.md
完成后: 记录发现的任何新模式或例外情况。
假设中断: 您的上下文可能会重置。如果它不在记忆中,那就意味着没有发生过。
每周安装次数
56
代码仓库
GitHub 星标数
23
首次出现
2026 年 1 月 27 日
安全审计
安装于
github-copilot54
gemini-cli53
cursor53
codex52
kimi-cli52
opencode52
When reviewing or writing code, apply these guidelines:
When reviewing or writing code, apply these guidelines:
When reviewing or writing code, apply these guidelines:
@MainActor for UI updates — SwiftUI and UIKit views must be modified on the main thread; background thread UI updates cause runtime crashes or silent visual corruption.@State for data that is shared between views — @State is local to the view and does not propagate changes to siblings or parents; use @ObservedObject, @EnvironmentObject, or @StateObject for shared model data.[weak self] in closures that capture self — strong self capture in closures that are held by the captured object creates retain cycles and memory leaks.| Anti-Pattern | Why It Fails | Correct Approach |
|---|---|---|
| UI updates from background threads | UIKit/SwiftUI are not thread-safe; random crashes, visual corruption, or silent failure | Dispatch to main: DispatchQueue.main.async or @MainActor annotated functions |
@State for shared model data | State is private to the view; sibling views don't see changes; inconsistent UI | Use @StateObject + @ObservableObject for model; pass via @ObservedObject |
| Strong self capture in async closures | Retain cycles prevent deallocation; memory grows unbounded |
This expert skill consolidates 1 individual skills:
Before starting:
cat .claude/context/memory/learnings.md
After completing: Record any new patterns or exceptions discovered.
ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.
Weekly Installs
56
Repository
GitHub Stars
23
First Seen
Jan 27, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
github-copilot54
gemini-cli53
cursor53
codex52
kimi-cli52
opencode52
Kotlin 开发模式与最佳实践 | 构建健壮高效应用程序的惯用指南
1,300 周安装
Ruby on Rails 应用开发指南:构建功能全面的Rails应用,包含模型、控制器、身份验证与最佳实践
303 周安装
自主智能体架构指南:从ReAct模式到可靠部署的最佳实践与风险规避
305 周安装
Jest TypeScript 测试配置指南 - 行业标准测试框架与TS集成教程
306 周安装
机构资金流向追踪器:分析13F文件追踪聪明钱,提前发现投资机会
307 周安装
Python代码审查工具:自动化检查PEP8、类型安全、异步模式与错误处理
311 周安装
Hono Cloudflare Workers 教程 - 构建边缘API与无服务器应用
306 周安装
const constructors and mark SwiftUI views as struct — class-based SwiftUI views lose automatic diffing optimization; struct views enable efficient identity tracking.[weak self] in all closures that are held beyond the current scope |
| Synchronous network calls | Blocks main thread; triggers ANR/watchdog; UI freezes | Use async/await with URLSession.data(for:) or Combine; always on background |
| Class-based SwiftUI views | Opt out of struct diffing optimization; slower rendering; lifecycle issues | Define all views as struct; only use class for ObservableObject models |