A lightweight yet powerful dependency injection library for Swift on Apple platforms and Linux.
DITranquillity is a dependency injection library for Swift that helps manage object dependencies in applications across iOS, macOS, tvOS, watchOS, and Linux. It solves the problem of tightly coupled code by providing a declarative way to define and resolve dependencies, promoting modularity and testability. The library supports various injection types, scopes, and integrates with UI components like Storyboards.
Swift developers building applications for Apple platforms or Linux who need a robust, type-safe dependency injection solution to manage complex object graphs and improve code maintainability.
Developers choose DITranquillity for its comprehensive feature set—including circular dependency handling, graph validation, and UI integration—combined with a focus on simplicity and safety. Its declarative syntax and support for modern Swift concurrency make it a powerful alternative to manual dependency management or lighter DI frameworks.
Dependency injection for iOS (Swift)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports initializer, property, and method injection with optional, tagged, and circular dependencies, enabling flexible dependency management as detailed in the core features.
Allows splitting dependency definitions into modules for better structure in large apps, promoting clean separation of concerns and maintainability.
Offers injection for Storyboards, view controllers, and subviews, making it easy to integrate dependency injection into iOS/macOS UI workflows without boilerplate code.
Provides APIs for dependency graph validation and retrieval, helping developers debug complex object relationships and ensure correct dependency resolution.
The dependency graph visualization feature is marked as not implemented in the README, limiting graphical debugging options compared to some alternatives.
Cocoapods is unsupported from version 5.0.0, forcing teams using this package manager to migrate to SwiftPM or Carthage, which can be disruptive.
The declarative style for dependency description, while powerful, requires a steep learning curve and deep understanding of DI concepts, which may overwhelm newcomers.