From 9bce294792f91f92adc0ae8909bbc2449d4ec39e Mon Sep 17 00:00:00 2001 From: Danis Ziganshin Date: Sun, 7 Jun 2026 17:45:29 +0300 Subject: [PATCH] =?UTF-8?q?Add=20migration=20ticket:=20UIKit/XIB/MVP=20?= =?UTF-8?q?=E2=86=92=20SwiftUI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A prompt that fires an agent to plan and implement migrating the UIKit scenes (MVP triples + XIBs) to SwiftUI while reusing the Core framework. Co-Authored-By: Claude Opus 4.8 --- migrations/02-swiftui.md | 58 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 migrations/02-swiftui.md diff --git a/migrations/02-swiftui.md b/migrations/02-swiftui.md new file mode 100644 index 0000000..fd7d3ea --- /dev/null +++ b/migrations/02-swiftui.md @@ -0,0 +1,58 @@ +# Migration: UIKit + XIB/Storyboard + MVP → SwiftUI + +> **Agent prompt — paste this to start the task.** +> +> You are migrating GrowingUp's UI layer from UIKit (XIBs/storyboards) with a +> hand-wired MVP/Clean setup to **SwiftUI**. First produce a concrete, +> scene-by-scene migration plan (post it for review), then implement it +> incrementally. +> +> **Current state** +> - The app target `GrowingUp` uses UIKit. Each feature under `Scenes/` is a +> **View ↔ Presenter ↔ Configurator** triple: +> `PersonsList`, `PersonOverview`, `EditPerson`, `EmptyPerson`, plus cell +> presenters (`TextFieldCell`, `DateCell`, `ImagesCell`, `ToggleCell`). +> - Views are `.xib`-backed `UIViewController`s; navigation is via `*Router` +> types; DI is manual in `*Configurator` (e.g. +> `PersonsListConfiguratorImplementation`). +> - Business logic lives in the `Core` framework (Entities, UseCases, +> Gateways, `AgeCalculator`) and must be **kept and reused** — this migration +> is UI-only. +> - Custom views in `GrowingUp/Views/` (`GradientView`, `VerticalButton`, +> `ImagePickerButton`) and a vendored `WDImagePicker` for photo cropping. +> - Resources are referenced via R.swift (`R.generated.swift`). Coordinate with +> the R.swift modernization ticket if relevant. +> +> **Goal** +> - Replace the UIKit scenes with SwiftUI views + observable view models, +> driving the same `Core` use cases. Preserve all existing behavior +> (add/edit/remove person, photo pick+crop, live age counting, EN/RU +> localization, App Group data sharing). +> +> **Plan must cover** +> 1. Migration order (suggest leaf-first: `EmptyPerson` → `PersonOverview` → +> `EditPerson` (with its cells) → `PersonsList`), and whether to do a +> `UIHostingController` bridge incrementally or a single cutover. +> 2. View-model strategy: map each Presenter to an `@Observable` / +> `ObservableObject` view model that calls the existing `Core` use cases; +> what to delete (Presenters, Configurators, Routers, XIBs) vs. keep. +> 3. Navigation: replace `*Router` with `NavigationStack` / value-based routing. +> 4. Photo pick + crop: replace `WDImagePicker` with `PhotosPicker` + +> a SwiftUI cropping approach (evaluate dropping the vendored library). +> 5. Live age: replace timer-driven `UILabel` updates with a SwiftUI +> `TimelineView`/timer publisher feeding `AgeCalculator`. +> 6. App entry point: keep `AppDelegate` (or move to `App`/`Scene` lifecycle) +> and how Core Data + App Group wiring is preserved. +> 7. Tests: the `Core`-level tests must keep passing; assess which presenter +> tests are replaced by view-model tests. +> 8. Deployment target: SwiftUI features assumed — coordinate with the +> deployment-target bump ticket (target iOS 16+ for `NavigationStack` / +> `@Observable` or note the floor used). +> +> **Acceptance criteria** +> - App builds and runs with feature parity; no remaining `.xib`/scene +> storyboards for migrated screens. +> - `Core` business logic unchanged and still unit-tested (green). +> - MVP scaffolding (Presenter/Configurator/Router) for migrated scenes removed. +> - EN/RU localization and App Group data sharing still work. +> - `Readme.md` architecture section updated to describe the SwiftUI structure.