# Swinject/Swinject

Dependency injection framework for Swift with iOS/macOS/Linux

Repository: https://github.com/Swinject/Swinject
Canonical: https://ross.abutalabs.com/products/swinject
Language: Swift
License: MIT
License Family: permissive
Topics: dependency-injection, di-container, swift, ios, ioc-container, inversion-of-control
Last push: 2025-09-01T20:09:08+00:00

## Health v2 (maintenance only)
Score: 42/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 39, release rhythm 13, longevity 100
- inputs: {"age_days": 4047, "days_push": 366, "days_rel": 366, "gap_med": null, "n_releases_24m": 1}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 6707, forks 539 (observed 2026-08-28T04:09:47.935816+00:00)

## What it is
Swinject is a lightweight dependency injection framework for Swift, implementing inversion of control via a DI container. It helps split apps into loosely-coupled components that are easier to develop, test, and maintain.

## Use cases
- resolve dependencies in a Swift iOS app with a DI container
- inject dependencies into view controllers via initializer or property injection
- manage singleton and transient object scopes in Swift
- break circular dependencies between Swift services
- make Swift code more testable with mock dependency injection
- organize app modules with assembler and container hierarchy

## When to choose
- you're building an iOS/macOS/tvOS/watchOS or server-side Swift app and want loosely-coupled, testable components
- you need a mature, actively maintained Swift DI framework with object scopes and circular dependency support

## When to avoid
- your project is small enough that manual initializer injection is sufficient
- you're not using Swift or the Apple/Linux Swift ecosystem

## Facets
- artifact type: library
- maturity: stable
- function: middleware, developer-tools
- domain: mobile-development, developer-tools, cross-platform
- platform: -
- tags: dependency-injection, di-container, ioc-container, swift, ios, macos, linux

## Member repositories
- Swinject/Swinject (main) score 42

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:47.935816+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:42:57.369921+00:00, confidence not recorded.
  - readme: https://github.com/Swinject/Swinject (fetched 2026-08-28T04:09:47.935816+00:00, sha f645d4461989)
- Data as of 2026-08-30T08:39:29.467469+00:00.
