Overview › Architecture & Module Structure
Architecture & Module Structure
29 SPM packages + CocoaPods hybrid; clean MVVM in feature modules.
80
SCORE
Summary
The iOS project is a hybrid CocoaPods + Swift Package Manager architecture. The main app (Costco) lives in an Xcode workspace alongside the Pods project. Feature work happens in 29 SPM packages under Costco-Digital/: 21 Features, 8 Core/infrastructure. Architecture is consistently MVVM in feature ViewModels, with a clean Core / CoreImplementation split.
Module map
| Layer | Packages | Notes |
|---|---|---|
| Core abstractions | Core | Network protocols, models, base utilities (iOS 16+, Swift 5.7) |
| Core implementation | CoreImplementation | CostcoNetworkClient, ServerTrustManager (cert pinning), Analytics |
| Storage | Storage | Persistence abstraction (Keychain, UserDefaults, CoreData) |
| Translation | Translation | Localization service over remote-config |
| Design system | CostcoDesignSystem, CostcoHeader | Pallet tokens (UIKit + SwiftUI), components |
| Content | CostcoContentstack | Contentstack 1.5+ + Adobe Target/Optimize |
| Mocking | Mockey | Internal test-double framework |
| Tooling | ClientTool, SampleCoreApp, SampleCostcoDesignSystem | Internal sample apps for development |
| Features (21) | Home, Shop, Cart, MyAccount, Inbox, Search, DMC, PDP, List, Saving, GRS, Warehouse, Geofence, AppTutorial, AppRating, Accounts, Authentication, OnBoarding, PasskeyManagerKit, ThreatMetrixKit, CostcoCommon | Vertical slices, MVVM |
Findings
PASS
Clean MVVM in feature ViewModels
Files like
SplashViewModel.swift, CartViewModel.swift, BottomNavBarViewModel.swift follow consistent ViewModel patterns. ObservableObject + @Published in SwiftUI; Combine subjects in UIKit-driven VMs.PASS
Core / CoreImplementation split
Core exposes protocols and models; CoreImplementation contains concrete classes (network client, trust manager, analytics). Features depend on the protocol package — clean.MEDIUM
Hybrid CocoaPods + SPM creates two dependency surfaces
CocoaPods Podfile owns RZVinyl (custom fork), SDWebImage (custom fork), RZTransitions, SwiftLint, plus snapshot test deps. SPM owns everything else. Two systems to update, two ways to onboard a dependency.
Recommendation: Track each Pod for SPM availability; migrate to SPM as upstream supports it. Eventually retire the Podfile.
MEDIUM
Sample apps in production source tree
SampleCoreApp, SampleCostcoDesignSystem are useful for development but live next to production code.Recommendation: Move sample apps to a
tools/ directory or separate repo to reduce mental load when navigating production code.MEDIUM
108 Obj-C files in main app
Legacy Obj-C concentrated in older flows. Each file is a Swift modernization opportunity.
Recommendation: Rank Obj-C files by current change frequency; convert hot files first.
No findings logged in this category yet for iOS.
Costco iOS · Code Review Report · Generated 2026-05-07 · 88 machine-curated findings