How sparta-nbcamp-ch3-advanced-team5/look-out-the-window works
Project type and purpose
• This is a native iOS weather‐forecast app called “Look‐out‐the‐window,” built in Swift and UIKit.
• It uses MVVM (Model–View–ViewModel) to fetch, persist, and present weather data (current, hourly, daily) and location information.
File structure
• Top‐level “Look-out-the-window” Xcode project and workspace.
• App folder: AppDelegate.swift and SceneDelegate.swift bootstrap the app.
• Data folder:
• CoreLocationManager for geolocation
• DTOs for parsing JSON responses
• Models for business data
• NetworkManager & APIEndpoints for REST calls
• CoreDataStorage for persistence
• Presentation folder (MVVM):
• Common (reusable views & compositional layout)
• RegionList, Register, WeatherDetail (each submodule has View, ViewController, ViewModel)
• Shared protocols, push notification center, extensions
Key architectural pattern
• MVVM with a Repository‐style Data layer.
• Single Scene architecture (UISceneSession).
• Asynchronous network calls and local caching via CoreData.
• CoreLocation service for live location.
Main components
a. App Shell
– AppDelegate & SceneDelegate (entry point, window setup, root navigation)
b. Presentation Layer (in green)
– Views & ViewControllers (RegionList, WeatherDetail, Register)
– ViewModels (RegionWeatherListViewModel, SearchResultViewModel, WeatherDetailViewModel, RegisterViewModel)
c. Data Layer (in blue)
– CoreLocationManager (location updates)
– NetworkManager + APIEndpoints (HTTP REST client)
– CoreDataStorage / CoreDataManager (local cache)
– DTO ↔ Model mappers
d. External Services (in gray)
– Third‐party Weather API (e.g., OpenWeatherMap)
– Push Notification Center
e. Resources (in orange)
– Rive Animations
– Asset Catalog
Relationships & data flow
1. User opens the app → SceneDelegate sets initial ViewController (RegionList)
2. ViewController binds to its ViewModel → requests location & weather data
3. ViewModel calls Data Layer:
– CoreLocationManager → returns CLLocation → ViewModel
– NetworkManager.fetch(WeatherEndpoint) → returns DTO → Model → ViewModel
– CoreDataManager.save(fetch result)
– CoreDataManager.load(cached data) on network failure
4. ViewModel updates ViewController via binding/delegation
5. For detail screens, NavigationController pushes WeatherDetailViewController
6. PushNotificationCenter registers for/handles remote notifications
Essential elements
• Component names (e.g., “NetworkManager”, “WeatherDetailViewModel”).
• Layers (Presentation, Data, External, Resources).
• Arrowheads showing call direction, callbacks, and data return paths.
• UI components (rounded corners)
• Services & managers (rectangles)