Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Swift
  3. DITranquillity

DITranquillity

MITSwiftv6.0.0

A lightweight yet powerful dependency injection library for Swift on Apple platforms and Linux.

GitHubGitHub
435 stars32 forks0 contributors

What is DITranquillity?

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.

Target Audience

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.

Value Proposition

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.

Overview

Dependency injection for iOS (Swift)

Use Cases

Best For

  • Implementing dependency injection in Swift-based iOS or macOS apps
  • Managing complex object graphs with circular dependencies
  • Building modular applications with separated dependency definitions
  • Integrating dependency injection with Storyboards and UIKit/AppKit views
  • Ensuring thread-safe dependency resolution in concurrent Swift code
  • Debugging and validating dependency structures via graph APIs

Not Ideal For

  • Projects relying exclusively on Cocoapods for dependency management, as support is dropped from version 5.0.0
  • Teams needing visual dependency graph tools for debugging, since the visualization feature is not yet implemented
  • Simple applications with minimal dependencies where manual injection or lighter frameworks would suffice
  • SwiftUI-focused projects without UIKit/AppKit, as UI integration is optimized for Storyboards and traditional views

Pros & Cons

Pros

Comprehensive Injection Support

Supports initializer, property, and method injection with optional, tagged, and circular dependencies, enabling flexible dependency management as detailed in the core features.

Modular Dependency Organization

Allows splitting dependency definitions into modules for better structure in large apps, promoting clean separation of concerns and maintainability.

Seamless UI Integration

Offers injection for Storyboards, view controllers, and subviews, making it easy to integrate dependency injection into iOS/macOS UI workflows without boilerplate code.

Graph Validation and Debugging

Provides APIs for dependency graph validation and retrieval, helping developers debug complex object relationships and ensure correct dependency resolution.

Cons

Incomplete Visualization Tooling

The dependency graph visualization feature is marked as not implemented in the README, limiting graphical debugging options compared to some alternatives.

Cocoapods Compatibility Loss

Cocoapods is unsupported from version 5.0.0, forcing teams using this package manager to migrate to SwiftPM or Carthage, which can be disruptive.

Declarative Syntax Complexity

The declarative style for dependency description, while powerful, requires a steep learning curve and deep understanding of DI concepts, which may overwhelm newcomers.

Frequently Asked Questions

Quick Stats

Stars435
Forks32
Contributors0
Open Issues3
Last commit1 month ago
CreatedSince 2016

Tags

#modular-architecture#ios#dependency-injection#ioc#design-patterns#tvos#inversion-of-control#di#linux#watchos#swift#macos#di-container

Built With

S
Swift

Included in

Swift26.0k
Auto-fetched 2 hours ago

Related Projects

SwinjectSwinject

Dependency injection framework for Swift with iOS/macOS/Linux

Stars6,707
Forks544
Last commit10 months ago
TyphoonTyphoon

Powerful dependency injection for Objective-C ✨✨ (https://github.com/appsquickly/pilgrim is the pure Swift successor to Typhoon!!)✨✨

Stars2,692
Forks261
Last commit5 years ago
DipDip

Simple Swift Dependency container. Use protocols to resolve your dependencies and avoid singletons / sharedInstances!

Stars980
Forks71
Last commit2 years ago
WeaverWeaver

Dependency Injection framework for Swift (iOS/macOS/Linux)

Stars769
Forks36
Last commit4 months ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub