Git Product home page Git Product logo

needle's Introduction

needle

Needle is a dependency injection system for Swift iOS apps. It utilizes code generation to ensure compile-time safey. If it compiles, it works.

Needle is currently in pre-release mode. We (Uber) are migrating all of our apps to Needle, therefore we haven't had the chance to finish the documentation. If you want to explore yourself feel free to use the following crude guide:

  1. Download the NeedleFoundation release from the Releases tab and include the source into your project.
  2. Follow the sample projects to create components and dependency protocols.
  3. Build a release version of Generator by running this command from the Generator folder of this repo swift build -c release -Xswiftc -static-stdlib.
  4. Invoke the resulting binary this command: needle generate "GENERATED_CODE_OUTPUT_FILE_PATH" "ROOT_FOLDER_OF_YOUR_PROJECT_SWIFT_SOURCE_FILES" --additional-imports "import YOUR_ROOT_MODULE" --header-doc "PATH_TO_A_TXT_HEADER_DOC_FILE" --exclude-suffixes Tests --exclude-paths "ANY_SUBFOLDERS_YOU_DO_NOT_WANT_TO_PARSE"
  5. Make sure the generated code file is included in your project.
  6. Invoke registerProviderFactories() in your main.swift or AppDelegate as the first line of code to execute.

After you update DI code, just re-run step 4 and everything should be good.

License

FOSSA Status

needle's People

Contributors

catri0na avatar neakor avatar rudro avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.