{"id":50706596,"url":"https://github.com/fededri/poc_ios_modularization","last_synced_at":"2026-06-09T12:31:34.791Z","repository":{"id":318754338,"uuid":"1072651107","full_name":"fededri/poc_ios_modularization","owner":"fededri","description":"A proof-of-concept demonstrating how to modularize an iOS application that uses Kotlin Multiplatform (KMP) for shared business logic, while maintaining proper navigation, testability, and preview support.","archived":false,"fork":false,"pushed_at":"2025-10-15T00:08:01.000Z","size":176,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-15T02:15:08.183Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fededri.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-09T03:01:44.000Z","updated_at":"2025-10-14T23:41:52.000Z","dependencies_parsed_at":"2025-10-15T04:45:14.360Z","dependency_job_id":null,"html_url":"https://github.com/fededri/poc_ios_modularization","commit_stats":null,"previous_names":["fededri/poc_ios_modularization"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/fededri/poc_ios_modularization","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fededri%2Fpoc_ios_modularization","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fededri%2Fpoc_ios_modularization/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fededri%2Fpoc_ios_modularization/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fededri%2Fpoc_ios_modularization/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fededri","download_url":"https://codeload.github.com/fededri/poc_ios_modularization/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fededri%2Fpoc_ios_modularization/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34107865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-09T02:00:06.510Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-09T12:31:34.281Z","updated_at":"2026-06-09T12:31:34.786Z","avatar_url":"https://github.com/fededri.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iOS Modularization POC with Kotlin Multiplatform\n\nThis repository explores different architectural approaches for modularizing an iOS application that uses Kotlin Multiplatform (KMP) for shared business logic.\n\n## Common Architecture Elements\n\nAll branches share these core principles:\n\n### Module Structure\n```\nCoreInterfaces (SPM)  → Protocols \u0026 Models\nAssets Module (SPM)   → Asset Features\nIssues Module (SPM)   → Issue Features\nApp Target            → Composition \u0026 KMP Bridge\nShared (KMP)          → Business Logic\n```\n\n### Critical Constraint\n**Only the App target can depend on KMP.** SPM modules use protocol abstractions; the App target provides KMP implementations via TCA's `@Dependency` system.\n\n### Dependency Injection\n1. Modules define repository protocols\n2. App target implements using KMP\n3. TCA's `@Dependency` injects implementations\n4. Mock implementations for previews/tests\n\n## Branch Overview\n\n### 🎯 [centralized_vanilla_swift](../../tree/centralized_vanilla_swift) (Recommended)\n\n**Approach:** Vanilla SwiftUI with path-based navigation and lifecycle-aware continuations.\n\n**Key Features:**\n- `@Observable` App Coordinator with NavigationPath\n- Async/await navigation for result-returning screens\n- Type-erased `NavigationContinuationManager` prevents memory leaks\n- Navigation Result Bus eliminates circular dependencies\n\n**Pros:**\n- Highly scalable (each module has its own navigation controller)\n- Standard Apple frameworks (no third-party nav libs)\n- Clean async/await API\n\n**Cons:**\n- Cannot observe NavigationPath changes directly (SwiftUI limitation)\n- Initial setup complexity\n- Continuation management requires understanding\n\n**Best for:** Production apps requiring robust navigation with multiple result-returning screens.\n\n---\n\n### 📦 [centralized_solution](../../tree/centralized_solution)\n\n**Approach:** TCA Reducer-based App Coordinator that listens to child actions.\n\n**Key Features:**\n- `@Reducer` struct AppCoordinator with StackState\n- TCA's ifCaseLet for path navigation\n- Coordinator listens to all child feature actions\n- Full TCA integration (actions, state, reducers)\n\n**Pros:**\n- Pure TCA solution (no Combine bridge needed)\n- Time-travel debugging works\n- Testable with TestStore\n- All navigation logic in reducers\n\n**Cons:**\n- Coordinator tightly coupled to all features\n- Every navigation action bubbles up to coordinator\n- Requires TCA boilerplate for navigation\n- Harder to add new modules (coordinator must know about them)\n\n**Best for:** Smaller apps or teams already deeply invested in TCA patterns.\n\n---\n\n### 📱 [modal_solution](../../tree/modal_solution)\n\n**Approach:** Decentralized navigation using sheet modals for cross-module navigation.\n\n**Key Features:**\n- Each module manages its own internal navigation\n- Cross-module navigation via sheets/modals\n- TCA's `@Presents` for modal destinations\n- No central coordinator needed\n\n**Pros:**\n- Modules are completely independent\n- No coordinator coupling\n- Simple to understand\n- Easy to add new modules\n\n**Cons:**\n- Cross-module navigation always shows as modal (UX limitation)\n- No drilldown navigation between modules\n- Cannot maintain navigation stack across modules\n- Back button behavior limited to modal dismissal\n\n**Best for:** Apps with mostly independent feature areas or where modal navigation is acceptable.\n\n---\n\n## Architecture Comparison\n\n| Aspect | centralized_vanilla_swift | centralized_solution | modal_solution |\n|--------|--------------------------|---------------------|----------------|\n| **Navigation Type** | Path-based (NavigationStack) | Path-based (StackState) | Modal-based (@Presents) |\n| **Coordinator** | Vanilla SwiftUI @Observable | TCA @Reducer | None |\n| **Cross-module Nav** | Push navigation | Push navigation | Sheet modals |\n| **Back Button** | Native stack pop | Native stack pop | Modal dismiss |\n| **Continuation Leaks** | Prevented ✅ | N/A | N/A |\n| **Result Handling** | Async/await + Result Bus | TCA actions | Callback closures |\n| **Scalability** | O(1) per nav type | O(n) with features | Excellent |\n| **Coupling** | Medium (bus + controllers) | High (knows all features) | Low |\n| **Testability** | Good (mock controllers) | Excellent (TestStore) | Good (mock repos) |\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffededri%2Fpoc_ios_modularization","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffededri%2Fpoc_ios_modularization","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffededri%2Fpoc_ios_modularization/lists"}