This repo is about a POC to work with the Uber's needle DI framework. It contains a base iOS project and instructions to get it run.
More info: https://github.com/uber/needle
Make sure Cocoapods is installed, then add the following pod:
pod 'NeedleFoundation'
brew install needle
You can also run the makefile in order to install Bundler, Carthage, Needle. Just run at the root of project:
$ make
Add a "Run Script" phase in the application's executable target's "Build Phases" section and put it before of Compile Sources
phase, then add the following command:
export SOURCEKIT_LOGGING=0 && needle generate $SRCROOT/$TARGETNAME/NeedleGenerated.swift $SRCROOT/$TARGETNAME
If you are using Carthage mathod
, please use the follow command instead:
export SOURCEKIT_LOGGING=0 && $SRCROOT/Carthage/Checkouts/needle/Generator/bin/needle generate $SRCROOT/$TARGETNAME/NeedleGenerated.swift $SRCROOT/$TARGETNAME
Please visit the official documentation to learn the basis of this lib here: Needle
You can found the final implementation at the branch needleImpl