How developeracademy-postech/2024-mc3-a05-phototodo works
Main Components
• App Core (PhotoTodo):
– Contains the main application entry point (PhotoTodoApp.swift) and central logic.
– Views: Multiple SwiftUI view files (e.g., MainView.swift, DashBoardView.swift, FolderListView.swift, TodoItemView.swift, etc.) that build the UI.
– View Models: Organized within the “ViewModel” directory (CameraManager.swift, CameraViewModel.swift, FolderManager.swift) to follow the MVVM pattern.
– Models: Data structures and domain objects defined in the “Models” folder (e.g., PhotoTodoModel.swift).
– Utilities and Extensions: Files such as Date+Extension.swift for common helper methods.
• Assets & Resources:
• Share Extension (ShareImage):
– A separate target/extension that includes its own storyboard (MainInterface.storyboard) and swift file (ShareViewController.swift) to handle sharing functionality.
• Project Configuration:
– The Xcode project files (PhotoTodo.xcodeproj and its associated workspace and configuration files) provide the build and deployment configuration.
Relationships & Interactions
• UI Layer ↔ ViewModel Layer:
– SwiftUI views interact with corresponding view models to manage state, capture images (via the CameraManager), and perform business logic to create todos.
• ViewModel Layer ↔ Model/Service Layer:
– The view models manipulate model objects (like PhotoTodoModel) and manage business processes (e.g., temporary storage and auto-deletion logic).
• Assets & Configuration:
– The assets are used by the UI for consistent branding and appearance. Info.plist and entitlements files configure permissions (e.g., for camera and notifications).
• Share Extension:
– Works independently but may share data or link back to the main app's functionality (e.g., shared storage or todo creation).
Architectural Patterns & Design Principles
• MVVM Pattern:
– The separation between views, view models, and models clarifies responsibilities and helps manage data flow in SwiftUI applications.
• Separation of Concerns:
– User interface components are separate from business logic and data handling.
• Modular Extension:
– The share extension is a distinct module that integrates with the main app but may have its own lifecycle and view structure.
Relevant Technologies & Frameworks
• Swift and SwiftUI: Core language and UI framework.
• Xcode Project Infrastructure: Including .xcodeproj, .xcworkspace files.
• Local data management: Temporary persistence and auto-delete functionality to minimize resource use and contribute to reduced digital carbon footprint.