Skip to content

iOS SwiftUI 视图重构

← All use cases

难度:高级

适用场景:Giant SwiftUI files where body mixes layout, branching, async work, and inline actions in one hard-to-review screen Existing iOS features that should stay visually and behaviorally identical while the internals become easier to maintain Screens with computed some View fragments, optional view models, or state plumbing that should be simplified into explicit subview inputs and callbacks

启动提示

Use the Build iOS Apps plugin and its SwiftUI view refactor skill to clean up [NameOfScreen.swift] without changing what the screen does or how it looks. Constraints:

  • Preserve behavior, layout, navigation, and business logic unless you find a bug that must be called out separately.
  • Default to MV, not MVVM. Prefer @State, @Environment, @Query, .task, .task(id:), and onChange before introducing a new view model, and only keep a view model if this feature clearly needs one.
  • Re...

由 Codex 构建