How nbcamp-week7-team6/ukhyun-exchange-rate-calculator works
Project type and purpose
• This is an iOS mobile application (“exchange-rate-calculator”) built in Swift using an MVVM + Clean Architecture pattern.
• Its purpose is to allow users to view and calculate currency exchange rates, cache recent rates locally, and save favorite currencies.
File structure
• Top-level “exchange-rate-calculator” folder contains:
• Application – AppDelegate, SceneDelegate, Assets, Storyboards
• Presentation – Views, ViewControllers, ViewModels, and ViewModel State/Action definitions
• Domain – Plain Swift Model types (CurrencyData, ExchangeRateData)
• Manager – networking (NetworkManager), caching (ExchangeRateCacheManager), favorites (FavoriteCurrencyManager)
• Core Data model & generated classes (CachedExchangeRate, FavoriteCurrency)
• Utility extensions (UIViewController, Double)
README
• Confirms MVVM + Clean Architecture as the guiding principles.
• User Interface Layer
– Views & ViewControllers (MainView, CalculatorView, ExchangeRateCellView, CalculatorViewController, etc.)
• Presentation Layer
– ViewModels + State machine (CalculatorViewModel, ViewModelState, ViewModelAction)
• Domain Layer
– Core data-free business models (CurrencyData, ExchangeRateData)
• Data Layer
– NetworkManager (fetch live rates from external API)
– ExchangeRateCacheManager & FavoriteCurrencyManager (persist/read Core Data entities)
– Core Data persistent store (Model.xcdatamodeld → CachedExchangeRate, FavoriteCurrency)
• Infrastructure / Application Layer
– AppDelegate / SceneDelegate (lifecycle, dependency assembly)
• External Services
– Third-party Exchange-Rate API over HTTPS
1. User taps in the UI → ViewController
2. ViewController invokes ViewModel methods (Action)
3. ViewModel calls Domain layer or directly calls Manager interfaces
4. Managers handle:
– NetworkManager → External API → returns JSON → Domain models
– CacheManager ↔ Core Data store
– FavoriteCurrencyManager ↔ Core Data store
5. ViewModel assembles new State and publishes it to the ViewController
6. ViewController updates Views
c. Architectural patterns & design principles
• MVVM separation: UI code in ViewControllers/Views; logic in ViewModels; pure models in Domain; side-effects in Managers.
• Clean Architecture boundaries: Presentation → Domain → Data → External.
• Dependency inversion: managers are abstracted behind protocols (where applicable).
• Single Responsibility: each layer/component has one clear role.
d. Key technologies & frameworks
• Swift + UIKit
• Core Data (persistent store)
• URLSession in NetworkManager
• Xcode project structure (.xcassets, Storyboards)
• MVVM + Clean Architecture
Details to capture
• AppDelegate/SceneDelegate initializing the root ViewController and injecting dependencies (e.g., NetworkManager, CacheManager).
• ViewController ↔ ViewModel binding (events & state).
• Delineate the two data paths: live-fetch (NetworkManager → Domain) vs. cache/favorites (Core Data).