GitHub | Issues | Installation | Usage | Atomic Object
Overview
objection is 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.
Features
-
“Annotation” Based Dependency Injection
-
Seamless support for integrating custom and external dependencies
- Custom Object Providers
- Meta Class Bindings
- Protocol Bindings
- Instance Bindings
-
Lazily instantiates dependencies
-
Eager Singletons
Usage
For a technical overview of the framework please visit the GitHub page
Installation
Download the latest here or
git clone git://github.com/atomicobject/objection.git
git checkout 0.11.0
iOS
- rake artifact:ios
- cp -R build/Release-iphoneuniversal/Objection-iOS.framework ${DEST_DIR}
- In XCode -> Project Icon -> Your Target -> Build Phases -> Link Binary With Libraries -> Add (+) -> Add Other
- Add -ObjC and -all_load to Other Link Flags in your project
Include framework
#import <Objection-iOS/Objection.h>
MacOS X
- rake artifact:osx
- cp -R build/Release/Objection.framework ${DEST_DIR}
- In XCode -> Project Icon -> Your Target -> Build Phases -> Link Binary With Libraries -> Add (+) -> Add Other
Include framework
#import <Objection/Objection.h>
Installation Notes
- There is a glitch in XCode that will cause header files to not be copied properly. So, if you are building the iOS target you may have to run the build process a couple of times to get all of the proper header files copied.
