How alperen23230/rick-and-morty-ios-app works
Main Components
• App Core: This includes the main application’s entry points (AppDelegate, SceneDelegate) and primary configurations.
• MVVM Layers: Within the “RickAndMortyiOS” directory, you have subdirectories for Screens (Characters, Episodes, Locations, Character Detail, and Main App) that illustrate the separation into Views and corresponding ViewModels.
• Domain Models & Entities: The Core/Entity directory holds the enumerations, models (network data models, error models) and possibly domain logic.
• Dependency Injection: Although not explicitly labeled, the presence of a dedicated “Core” and various distinct modules implies dependency injection is set up to decouple components.
• Widget Module: The RickAndMortyWidget directory is a separate module that handles iOS 14 widget functionality.
Relationships and Interactions
• UI (Screens & Custom Views) ⇔ ViewModels: Illustrate that each screen (such as a view controller or custom view) communicates with a corresponding view model which contains the presentation logic.
• ViewModels ⇔ Networking/Domain: The view models invoke services from the Networking layer to fetch or post data. This data is defined and structured via the Entity/Models classes.
• Networking Layer: Show that network requests (CharactersRequest, EpisodesRequest, LocationsRequest, etc.) are managed by a network service which also relies on Combine to handle asynchronous operations.
• Extensions/Utilities: These are used across the various components to support common functionalities, which can be represented as shared libraries.
• Widget:
Architectural Patterns and Design Principles
• MVVM: Clearly demarcate the boundaries between Models, Views, and ViewModels.
• Reactive Programming: Show that Combine is used for handling observable data streams between the layers.
• Modularization: Illustrate the separation between the main app and the widget extension.
• Reusability: Note that commonly used UI and utility extensions are abstracted into reusable components.
Relevant Technologies or Frameworks
• UIKit (given the use of storyboards and Xcode project structure)
• Combine (reactive programming)
• Diffable Data Sources and Compositional Layout (for dynamic UI updates)
• Possibly a DI framework or custom dependency injection techniques
• Core Data (planned caching, though currently not implemented)
• iOS WidgetKit (for the widget extension, indirectly indicated by widget support files)
Elements
• Use clear labels for each component:
• “Main App UI” (with sub-components like Characters Screen, Episodes Screen, etc.)
• “ViewModels” for corresponding screens
• “Networking Service” and individual request components
• “Domain/Entity Models”
• “Widget Extension”
• “Shared Extensions & Utilities”
• From UI components to their respective ViewModels (data-binding directions)
• From ViewModels to Networking/Services indicating API requests.
• Data flow from Networking back to the ViewModels (using Combine publishers).
• Dependency injection paths between components.
• UI components (e.g., rounded rectangles)
• Relationships, such as “invokes”, “updates”, “communicates with”, etc.