{"id":16203320,"url":"https://github.com/sschmid/sdobjection","last_synced_at":"2026-03-04T05:31:23.913Z","repository":{"id":5709829,"uuid":"6920776","full_name":"sschmid/SDObjection","owner":"sschmid","description":"A lightweight dependency injection framework for Objective-C.","archived":false,"fork":false,"pushed_at":"2013-01-10T13:19:00.000Z","size":350,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-19T18:49:47.698Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sschmid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-11-29T12:23:11.000Z","updated_at":"2023-07-03T16:50:24.000Z","dependencies_parsed_at":"2022-08-24T21:32:06.154Z","dependency_job_id":null,"html_url":"https://github.com/sschmid/SDObjection","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/sschmid/SDObjection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschmid%2FSDObjection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschmid%2FSDObjection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschmid%2FSDObjection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschmid%2FSDObjection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sschmid","download_url":"https://codeload.github.com/sschmid/SDObjection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschmid%2FSDObjection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30072495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T05:13:31.218Z","status":"ssl_error","status_checked_at":"2026-03-04T05:10:24.293Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-10T09:53:45.910Z","updated_at":"2026-03-04T05:31:23.768Z","avatar_url":"https://github.com/sschmid.png","language":"Objective-C","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Description\n\nSDObjection is modified version of [Objection] - a lightweight dependency injection framework for Objective-C for MacOS X and iOS. For those of you that have used Guice objection will feel familiar. Objection was built to stay out of your way and alleviate the need to maintain a large XML container or manually construct objects.\n\n## Features\n\n* \"Annotation\" Based Dependency Injection\n* Seamless support for integrating custom and external dependencies\n  * Custom Object Providers\n  * Meta Class Bindings\n  * Protocol Bindings\n  * Instance Bindings\n* Lazily instantiates dependencies\n* Eager Singletons\n* Initializer Support\n  * Default and custom arguments\n\n\n## What's different from [Objection]\n\n* No global context\n* No objection_register or objection_register_singleton\n * This is handled automatically in modules\n* Injector lets you add and remove modules at any time\n* Removing modules also remove their bindings\n* Injector lets you inject into existing objects\n\n## Using SDObjection\n\n#### Create an injector\n\n```objective-c\nJSObjectionInjector *injector = [JSObjection createInjector];\n[JSObjection setDefaultInjector:injector];\n```\n\n#### Add modules\n\n```objective-c\n[injector addModule:[[SomeModule alloc] init]];\n[injector addModule:[[SomeOtherModule alloc] init] withName:@\"otherModule\"];\n```\n\n#### Remove modules\n\n```objective-c\n[injector removeModuleInstance:someModule];\n[injector removeModuleClass:[SomeModule class]];\n[injector removeModuleWithName:@\"otherModule\"];\n[injector removeAllModules];\n```\n\n#### Ask\n\n```objective-c\nBOOL hasModule = [injector hasModuleClass:[SomeModule class]];\nBOOL hasModuleWithName = [injector hasModuleWithName:name];\n```\n\n#### Configure modules\n\n```objective-c\n- (void)configure {\n    [super configure];\n\n   // Configure here\n\n   [self bindClass:[Foo class] toProtocol:@protocol(FooProtocol) asSingleton:YES];\n   [self bind:[[Bar alloc] init] toProtocol:@protocol(BarProtocol)];\n   [self registerSingleton:[SingleFoo class]];\n   [self registerEagerSingleton:[EagerBar class]];\n   \n   // there are many more binding options...\n}\n\n- (void)start {\n    [super start];\n\n    // All configured bindings are ready to use\n    [[self.injector getObject:@protocol(BarProtocol)] bar];\n    [[self.injector getObject:[SingleFoo class]] foo];\n}\n\n- (void)unload {\n   \n   // Optional unloading here. Gets called, when modules get removed.\n   // All configured bindings will get removed automatically.\n \n   [super unload];\n}\n```\n\n## Use SDObjection in your project\n\nYou find the source files you need in Pods/Objection/Source\n\nTo use SDObjection with ARC, you might want to set it up with [CocoaPods] like this:\n\nCreate a Podfile and put it into your root folder of your project\n\n#### Edit your Podfile\n```\nplatform :ios, '5.0'\n\npod 'SDObjection'\n```\n\n#### Setup [CocoaPods], if not done already\n\n```\n$ sudo gem install cocoapods\n$ pod setup\n```\n\n#### Add this remote\n```\n$ pod repo add sschmid-cocoapods-specs https://github.com/sschmid/cocoapods-specs\n```\n\n#### Install SDObjection\n```\n$ cd path/to/project\n$ pod install\n```\n\n## Other projects using SDObjection\nIf you enjoy using SDObjection in your projects let me know, and I'll mention your projects here.\n\n[Objection]: https://github.com/atomicobject/objection\n[CocoaPods]: http://cocoapods.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsschmid%2Fsdobjection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsschmid%2Fsdobjection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsschmid%2Fsdobjection/lists"}