Swift Dependency Injection

Open-source Swift projects categorized as Dependency Injection

Top 23 Swift Dependency Injection Projects

  • Swinject

    Dependency injection framework for Swift with iOS/macOS/Linux

    Project mention: Dependency Injection Simplified | dev.to | 2023-02-09

    DI is a concept which makes a class independent of its dependency management. It achieves that by decoupling the usage of an object from its creation. This helps you to follow SOLID’s dependency inversion and single responsibility principles. To achieve this in Swift one of the most appreciated library is Swinject. This library not only provides DI but also have many other features like:-

  • Resolver

    Swift Ultralight Dependency Injection / Service Locator framework

  • Appwrite

    Appwrite - The open-source backend cloud platform. Add Auth, Databases, Functions, and Storage to your product and build any application at any scale while using your preferred coding languages and tools.

  • Cleanse

    Lightweight Swift Dependency Injection Framework

  • Needle

    Compile-time safe Swift dependency injection framework

  • Factory

    A new approach to Container-Based Dependency Injection for Swift and SwiftUI. (by hmlongco)

    Project mention: What is a piece of code (or Framework, extension, etc.) that you add in every new project? | /r/swift | 2023-02-24

    I prefer Factory over Dependencies (since I wrote it). You can use the SwuftUI environment-style syntax for injection, and registering a new dependency type is much, much simpler than using an EnvironmentKey approach.

  • swift-dependencies

    A dependency management library inspired by SwiftUI's "environment."

    Project mention: Good Swift Repositories for Experienced Dev | /r/swift | 2023-06-28

    I’d sincerely recommend the video series and associated repositories on https://www.pointfree.co

  • iOSSampleApp

    Sample iOS app demonstrating Coordinators, Dependency Injection, MVVM, Binding

  • InfluxDB

    Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.

  • Weaver

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

  • SecurePropertyStorage

    Helps you define secure storages for your properties using Swift property wrappers.

  • DITranquillity

    Dependency injection for iOS (Swift)

  • Pure

    Pure DI in Swift (by devxoul)

  • Deli

    Deli is an easy-to-use Dependency Injection(DI).

  • Locatable

    A micro-framework that leverages Swift Property Wrappers to implement the Service Locator pattern

  • DIKit

    Dependency Injection Framework for Swift, inspired by KOIN.

  • pilgrim

    Dependency injection for Swift (iOS, OSX, Linux). Strongly typed, pure Swift successor to Typhoon.

  • Corridor

    A Coreader-like Dependency Injection μFramework

  • Guise

    An elegant, flexible, type-safe dependency resolution framework for Swift (by Prosumma)

  • AnnotationInject

    Compile-time type safe Swift dependency injection annotations

  • Impose

    Impose is a simple dependency injection library for Swift

  • StoryboardBuilder

    Simple dependency injection for generating views from storyboard.

  • ViperServices

    Simple dependency injection container for services written for iOS in swift supporting boot order

  • Syringe

    A lightweight dependency injection(DI) framework written in Swift. (by broken-bytes)

    Project mention: Attempt at modern DI framework replacement for Swinject | /r/iOSProgramming | 2023-03-22
  • TinyDi

    A Lightweight Swift Dependency Injection Package

  • Onboard AI

    Learn any GitHub repo in 59 seconds. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at www.getonboard.dev.

NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020). The latest post mention was on 2023-06-28.

Swift Dependency Injection related posts


What are some of the best open-source Dependency Injection projects in Swift? This list will help you:

Project Stars
1 Swinject 6,018
2 Resolver 2,059
3 Cleanse 1,747
4 Needle 1,650
5 Factory 1,349
6 swift-dependencies 1,180
7 iOSSampleApp 750
8 Weaver 726
9 SecurePropertyStorage 469
10 DITranquillity 404
11 Pure 368
12 Deli 134
13 Locatable 116
14 DIKit 101
15 pilgrim 61
16 Corridor 61
17 Guise 55
18 AnnotationInject 40
19 Impose 11
20 StoryboardBuilder 6
21 ViperServices 5
22 Syringe 4
23 TinyDi 1
Learn any GitHub repo in 59 seconds
Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at www.getonboard.dev.