{"id":20957775,"url":"https://github.com/marekpridal/swinjectlight","last_synced_at":"2026-04-12T19:52:26.208Z","repository":{"id":244532221,"uuid":"811327989","full_name":"marekpridal/SwinjectLight","owner":"marekpridal","description":"Lightweight dependency injection framework for Swift (inspired by Swinject)","archived":false,"fork":false,"pushed_at":"2025-01-24T14:55:56.000Z","size":37,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T16:40:41.780Z","etag":null,"topics":["apple","dependencies","dependency","dependency-injection","ios","ipados","linux","macos","swift","swift-package-manager","tvos","ubuntu","visionos","watchos","windows"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marekpridal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-06T11:39:09.000Z","updated_at":"2025-01-24T14:54:19.000Z","dependencies_parsed_at":"2025-03-11T16:34:38.570Z","dependency_job_id":"822ff21d-cd14-456f-936d-2a6936f2e6ff","html_url":"https://github.com/marekpridal/SwinjectLight","commit_stats":null,"previous_names":["marekpridal/swinjectlight"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marekpridal%2FSwinjectLight","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marekpridal%2FSwinjectLight/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marekpridal%2FSwinjectLight/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marekpridal%2FSwinjectLight/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marekpridal","download_url":"https://codeload.github.com/marekpridal/SwinjectLight/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243352035,"owners_count":20276916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apple","dependencies","dependency","dependency-injection","ios","ipados","linux","macos","swift","swift-package-manager","tvos","ubuntu","visionos","watchos","windows"],"created_at":"2024-11-19T01:43:57.126Z","updated_at":"2025-12-31T01:03:15.879Z","avatar_url":"https://github.com/marekpridal.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SwinjectLight\n\n![Build](https://github.com/marekpridal/SwinjectLight/actions/workflows/build.yml/badge.svg) ![Test](https://github.com/marekpridal/SwinjectLight/actions/workflows/test.yml/badge.svg) ![platforms](https://img.shields.io/badge/platform-iOS%20%7C%20watchOS%20%7C%20tvOS%20%7C%20macOS%20%7C%20Windows%20%7C%20Ubuntu%20%7C%20Android-333333) [![Swift Package Manager compatible](https://img.shields.io/badge/Swift%20Package%20Manager-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager) ![GitHub](https://img.shields.io/github/license/marekpridal/SwinjectLight) ![GitHub All Releases](https://img.shields.io/github/downloads/marekpridal/SwinjectLight/total)\n\nSwinjectLight is framework for lightweight dependency injection which works on any platform supporting Swift. Framework took inspiration from original [Swinject](https://github.com/Swinject/Swinject) implementation but removes some more complex functionality which is usually not necessary.\n\n## Installation\n\n### [Swift Package Manager](https://github.com/apple/swift-package-manager)\n\nTo add a package dependency to your Xcode project, select File \u003e Add Package Dependency and `https://github.com/marekpridal/SwinjectLight`.\n\nAlternatively in `Package.swift` add the following\n\n```swift\n// swift-tools-version:5.10\n\nimport PackageDescription\n\nlet package = Package(\n  name: \"SwinjectLightExample\",\n  dependencies: [\n    .package(url: \"https://github.com/marekpridal/SwinjectLight\", from: \"1.0.0\")\n  ],\n  targets: [\n    .target(name: \"SwinjectLightExample\", dependencies: [\"SwinjectLight\"])\n  ]\n)\n```\n\n## Usage\n```swift\nimport SwinjectLight\n\n// Create container\nlet container = Container()\n\n// Register singleton dependency\ncontainer.register(Session.self) { r in\n    DefaultSession.shared\n}\n\n// Register instance based dependency\ncontainer.register(Api.self) { r in\n    Networking(session: r.resolve(Session.self))\n}\n\n// Resolve dependency\nlet api = container.resolve(Api.self)\n```\n\nYou can also check out [demo project in repo](DIDemoApp) for further details about usage.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarekpridal%2Fswinjectlight","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarekpridal%2Fswinjectlight","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarekpridal%2Fswinjectlight/lists"}