Typhoon

typhoonframework.org

Powerful dependency injection for Cocoa and CocoaTouch. Lightweight, yet full-featured and super-easy to use.

Not familiar with Dependency Injection?

Visit the Typhoon website for an introduction. There's also a nice intro over at Big Nerd Ranch, or here's an article, by John Reid. Quite a few books have been written on the topic, though we're not familiar with one that focuses specifically on Objective-C, Swift or Cocoa yet.

Is Typhoon the right DI framework for you?

Check out the feature list.

Looking for a pure Swift Solution?

Typhoon uses the Objective-C runtime to collect metadata and instantiate objects. It powers thousands of Objective-C applications and is also pretty popular for Swift. Nonetheless there are some advantages to using a pure Swift library.

  • Typhoon Swift is available! It uses 'compile-time' code generation.
  • Fiery Crucible is also an excellent light-weight (just one file) and very straight-forward DI library for Swift.

Both of the above solutions have the 'ObjectGraph' scope (you can read more about it in the docs), which provides a way to assemble a complex object-graph from a blue-print and then retain it as long as needed. This scope was introduced by Typhoon, and is an important consideration for mobile and desktop apps. Moreover, scope management is one of the main advantages to simply applying the DI pattern 'by hand'.

Please think carefully before choosing a DI library that forces you to write complex adapters, modify your code or tightly couple it to a library. It shouldn't be more complicated than understanding and applying the pattern without a supporting framework.


Usage

let assembly = MyAssembly().activated()
let viewControler = assembly.recommendationController() as! RecommendationController

Open Source Sample Applications

Have a Typhoon example app that you'd like to share? Great! Get in touch with us :)

Installing

CocoaPods Version Pod Platform Carthage compatible Dependency Status Pod License

Typhoon is available through CocoaPods or Carthage, and also builds easily from source.

With CocoaPods . . .

Static Library


# platform *must* be at least 5.0
platform :ios, '5.0'

target :MyAppTarget, :exclusive => true do

pod 'Typhoon'

end

Dynamic Framework

If you're using Swift, you may wish to install dynamic frameworks, which can be done with the Podfile shown below:

# platform *must* be at least 8.0
platform :ios, '8.0'

# flag makes all dependencies build as frameworks
use_frameworks!

# framework dependencies
pod 'Typhoon'

Simply import the Typhoon module in any Swift file that uses the framework:

import Typhoon

With Carthage

github "appsquickly/Typhoon"

From Source

Alternatively, add the source files to your project's target or set up an Xcode workspace.

NB: All versions of Typhoon work with iOS5 and up (and OSX 10.7 and up), iOS8 is only required if you wish to use dynamic frameworks.


Feedback

I'm not sure how to do [xyz]

If you can't find what you need in the Quick Start or User Guides above, then Typhoon users and contributors monitor the Typhoon tag on Stack Overflow. Chances are your question can be answered there.

I've found a bug, or have a feature request

Please raise a GitHub issue.

Interested in contributing?

Great! Here's the contribution guide.

I'm blown away!

Typhoon is a non-profit, community driven project. We only ask that if you've found it useful to star us on Github or send a tweet mentioning us (@appsquickly). If you've written a Typhoon related blog or tutorial, or published a new Typhoon powered app, we'd certainly be happy to hear about that too.

Typhoon is sponsored and lead by AppsQuick.ly with contributions from around the world.


© 2012 - 2015 Jasper Blues, Aleksey Garbarev and contributors.

Related Repositories

typhoon-blade

typhoon-blade

Building system of typhoon cloud computing platform of tencent, support C/C++/pr ...

Typhoon-Swift-Example

Typhoon-Swift-Example

Swift example application for Typhoon ...

Typhoon-example

Typhoon-example

An example application built with Typhoon dependency injection framework. ...

TyphoonSwift

TyphoonSwift

Powerful dependency injection for iOS & OSX working on a pure Swift ...

LRRepositoryPattern

LRRepositoryPattern

An iOS example app based on the repository pattern and Typhoon DI framework ...


Top Contributors

jasperblues alexgarbarev rhgills etolstoy nickynick drodriguez cesteban vasilenkoigor mbaltaks CognitiveDisson eriksundin mowens mogol xr1337 warnyul bmorganpa pwightman RomainLo VojtechBartos jervine10 akiraspeirs Emailrus fatuhoku IvanUshakov jgongo peterkutasi skywinder ReadmeCritic Ricowere plandem

Releases

-   3.5.1 zip tar
-   3.5.0 zip tar
-   3.4.9 zip tar
-   3.4.8 zip tar
-   3.4.7 zip tar
-   3.4.6 zip tar
-   3.4.5 zip tar
-   3.4.4 zip tar
-   3.4.3 zip tar
-   3.4.2 zip tar
-   3.4.1 zip tar
-   3.4.0 zip tar
-   3.3.4 zip tar
-   3.3.3 zip tar
-   3.3.2 zip tar
-   3.3.1 zip tar
-   3.3.0 zip tar
-   3.2.8 zip tar
-   3.2.7 zip tar
-   3.2.6 zip tar
-   3.2.5 zip tar
-   3.2.4 zip tar
-   3.2.3 zip tar
-   3.2.2 zip tar
-   3.2.1 zip tar
-   3.2.0 zip tar
-   3.1.9 zip tar
-   3.1.8 zip tar
-   3.1.7 zip tar
-   3.1.6 zip tar