125

GitHub - uber/needle: Compile-time safe Swift dependency injection framework wit...

 5 years ago
source link: https://github.com/uber/needle
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

README.md

Needle

Build Status Carthage compatible License

Needle is a dependency injection (DI) system for Swift. Unlike other DI frameworks, such as Cleanse, Swinject, Needle encourages hierarchical DI structure and utilizes code generation to ensure compile-time safety. This allows us to develop our apps and make changes with confidence. If it compiles, it works. In this aspect, Needle is more similar to Android Dagger.

Why use dependency injection?

The linked document uses a somewhat real example to explain what the dependency injection pattern is, and its benefits.

Getting started with Needle

Using and integrating with Needle has three steps. Each of the following steps has detailed instructions and explanations in the linked documents.

  1. Include NeedleFoundation module in your Swift project.
  2. Integrate Needle's code generator with your Swift project.
  3. Write application DI code following NeedleFoundation's API.

License

FOSSA Status


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK