Skip to content

A Swift MVP + injection module template with UIViewController playing as a View.

Notifications You must be signed in to change notification settings

mihailsalari/swift-mvp-injection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Swift MVP + Dependency Injection Architecture

MVP (Model-View-Presenter) is a derivation of the model–view–controller architectural pattern, primarily used for building user interfaces. In MVP, the presenter embodies the "middle-man" functionality, consolidating all presentation logic.

In the tech world, where launching swiftly is as vital as scalability, choosing the right architecture is crucial. That's where MVP+DI comes in as a game-changer. While MVP (Model-View-Presenter) carves a distinct space for user interface, data, and logic, ensuring clarity and flexibility, DI (Dependency Injection) amplifies this by offering dynamic dependency management.

The brilliance of MVP+DI lies in its innate simplicity merged with scalability. For startups and small projects aiming for MVP (Minimum Viable Product) releases, this combination is optimal. It allows a project to start on a lean foundation but is inherently structured to accommodate growth and evolution.

In essence, if you're envisioning a project that's compact at the outset but has grand ambitions, MVP+DI is the architectural duo you've been seeking.

Swift Version

Tutorials 📚

Deep dive into the structure and benefits of this architecture with these articles:

Setup 🛠

Installation

  1. Add template to your Rambafile:
templates:
 - {name: swift-mvp-injection, git: 'https://github.com/mihailsalari/swift-mvp-injection.git'}
  1. Install the template:
generamba template install

Usage

Generate your desired module with the following command:

generamba gen [MODULE_NAME] [TEMPLATE_NAME]

Example:

To create a Splash module:

generamba gen Splash swift-mvp-injection

This will generate the Splash module in both your project and tests target.

Contribute 🤝

We encourage everyone to contribute and make improvements. Feel free to submit a pull request or provide feedback!

Questions ❓

For general inquiries, consider asking on Stack Overflow. The author regularly monitors the MVP tag there for prompt responses. Alternatively, reach out at:

About

A Swift MVP + injection module template with UIViewController playing as a View.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages