Loading...
Loading...
Compare original and translation side by side
React Code → Understand Feature → Match iOS Codebase Patterns → Implement
(what) (how it's done here)React代码 → 理解功能 → 匹配iOS代码库模式 → 实现
(功能是什么) (这里的实现方式)| React/React Native | iOS/Swift Equivalent |
|---|---|
| |
| |
| Environment objects / Dependency injection |
| Computed properties / lazy vars |
| State machine / Combine |
| Props | Init parameters / Bindings |
| SwiftUI |
| |
| |
| |
| |
| |
| |
| SwiftUI modifiers / UIKit constraints |
| |
| Redux / Zustand | Combine / SwiftUI state / TCA |
| React Navigation | |
| React Query / SWR | Async/await patterns / Combine |
| Styled Components | View modifiers / custom ViewModifiers |
| Context Providers | |
| React/React Native | iOS/Swift 等效方案 |
|---|---|
| |
| |
| Environment对象 / 依赖注入 |
| 计算属性 / 延迟变量 |
| 状态机 / Combine |
| Props | 初始化参数 / Bindings |
| SwiftUI |
| |
| |
| |
| |
| |
| |
| SwiftUI修饰符 / UIKit约束 |
| |
| Redux / Zustand | Combine / SwiftUI状态管理 / TCA |
| React Navigation | |
| React Query / SWR | Async/await模式 / Combine |
| Styled Components | View修饰符 / 自定义ViewModifiers |
| Context Providers | |
To port a feature from React to iOS, I need:
1. PATH TO REACT CODEBASE (source of truth)
Where is the React/React Native project located?
Example: /path/to/react-app or ../react-native-app
2. FEATURE TO IMPLEMENT
What feature or component should I port?
Example: "UserProfile component" or "the checkout flow" or "src/components/Dashboard"要将功能从React移植到iOS,我需要:
1. React代码库路径(基准实现)
React/React Native项目的位置在哪里?
示例:/path/to/react-app 或 ../react-native-app
2. 要实现的功能
要移植哪个功能或组件?
示例:"UserProfile组件" 或 "结账流程" 或 "src/components/Dashboard".tsx.jsx.jsuse*.ts.ts.d.ts.tsx.jsx.jsuse*.ts.ts.d.ts| Aspect | What to Extract |
|---|---|
| Feature Behavior | What does this feature do? User-facing functionality |
| Component Structure | Component hierarchy, props, composition patterns |
| State Management | useState, useReducer, Redux, Context usage |
| Side Effects | useEffect patterns, data fetching, subscriptions |
| Business Logic | Validations, transformations, calculations |
| API Contracts | Network calls, request/response shapes |
| UI Flow | Screens, navigation, user interactions |
| Edge Cases | Error handling, loading states, empty states |
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REACT FEATURE ANALYSIS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━| 维度 | 需要提取的信息 |
|---|---|
| 功能行为 | 该功能的作用是什么?面向用户的功能 |
| 组件结构 | 组件层级、Props、组合模式 |
| 状态管理 | useState、useReducer、Redux、Context的使用方式 |
| 副作用处理 | useEffect模式、数据获取、订阅逻辑 |
| 业务逻辑 | 验证、转换、计算逻辑 |
| API契约 | 网络请求、请求/响应格式 |
| UI流程 | 页面、导航、用户交互 |
| 边界情况 | 错误处理、加载状态、空状态 |
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
React功能分析
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━undefinedundefined.claude/codebase-style.md━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
iOS CODEBASE PATTERNS
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Style Guide: [Found / Not found]
Patterns observed from existing code:
- Architecture: [MVVM / MVC / TCA / VIPER / etc.]
- UI Framework: [SwiftUI / UIKit / Mixed]
- State: [how state is managed]
- Networking: [how API calls are made]
- DI: [how dependencies are injected]
- Navigation: [how navigation works]
Similar features to reference:
- [Feature 1]: [path]
- [Feature 2]: [path]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━.claude/codebase-style.md━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
iOS代码库模式
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
风格指南:[已找到 / 未找到]
从现有代码中观察到的模式:
- 架构:[MVVM / MVC / TCA / VIPER / 其他]
- UI框架:[SwiftUI / UIKit / 混合]
- 状态管理:[状态管理方式]
- 网络请求:[API请求实现方式]
- 依赖注入:[依赖注入方式]
- 导航:[导航实现方式]
可参考的类似功能:
- [功能1]:[路径]
- [功能2]:[路径]
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
IMPLEMENTATION PLAN
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
实现计划
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━| # | File | Purpose | React Equivalent |
|---|---|---|---|
| 1 | [path matching codebase conventions] | [purpose] | [React file] |
| 2 | ... | ... | ... |
| 序号 | 文件路径 | 用途 | React等效文件 |
|---|---|---|---|
| 1 | [符合代码库规范的路径] | [用途] | [React文件] |
| 2 | ... | ... | ... |
| React Concept | iOS Equivalent (matching codebase patterns) |
|---|---|
| [React thing] | [iOS equivalent as done in this codebase] |
| ... | ... |
| React概念 | iOS等效实现(匹配代码库模式) |
|---|---|
| [React概念] | [符合当前代码库模式的iOS实现方式] |
| ... | ... |
| React State | iOS State Management |
|---|---|
| [useState/Redux/etc.] | [How it maps to iOS patterns] |
undefined| React状态 | iOS状态管理方式 |
|---|---|
| [useState/Redux等] | [映射到iOS模式的方式] |
undefined| React Pattern | iOS Implementation |
|---|---|
| Component with props | |
| useState + setState | |
| useEffect on mount | |
| useEffect with deps | |
| useEffect cleanup | |
| Conditional rendering | |
| List mapping | |
| Event handlers | Action closures or Bindings |
| CSS/StyleSheet | SwiftUI modifiers or custom |
.swiftruby ${CLAUDE_PLUGIN_ROOT}/skills/add-to-xcode/scripts/add_to_xcode.rb <filepath>add-to-xcode| React模式 | iOS实现方式 |
|---|---|
| 带Props的组件 | 带初始化参数或 |
| useState + setState | 可直接修改的 |
| 挂载时的useEffect | |
| 带依赖的useEffect | |
| useEffect清理 | |
| 条件渲染 | |
| 列表映射 | |
| 事件处理器 | 动作闭包或Bindings |
| CSS/StyleSheet | SwiftUI修饰符或自定义 |
.swiftruby ${CLAUDE_PLUGIN_ROOT}/skills/add-to-xcode/scripts/add_to_xcode.rb <filepath>add-to-xcode━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
REACT → iOS COMPLETE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
React → iOS 移植完成
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━| File | Purpose |
|---|---|
| [path] | [description] |
| 文件路径 | 用途 |
|---|---|
| [路径] | [描述] |
---
---"react to ios"
"react native to ios"
"convert from react"
"port this react component to swift"
"implement this react feature for ios"
"ios version of this react code"
"native ios from react native"
"migrate react native to swift""react to ios"
"react native to ios"
"convert from react"
"port this react component to swift"
"implement this react feature for ios"
"ios version of this react code"
"native ios from react native"
"migrate react native to swift"style-guidestyle guide ← Run this first on iOS codebase
react to ios ← Then run this.claude/codebase-style.mdstyle-guidestyle-guidestyle guide ← 先在iOS代码库上运行此命令
react to ios ← 然后运行此命令.claude/codebase-style.mdstyle-guide