typhoon-framework/Typhoon — pull request #290 by mowens (2014-12-09 06:08:53+00:00)
Title: Adding target for building Typhoon as a dynamic framework for iOS

This will allow projects that build as dynamic framework (e.g. Swift libraries) to link against Typhoon as dynamic frameworks cannot link against static libraries (e.g. Cocoapods).

Included in this commit:
- New build target called "Typhoon" that will build the Typhoon library as a cocoa dynamic framework :)
- New build target called "TyphoonFrameworkSwiftExample" that will build an foobar iOS app that links against Typhoon.framework, sets up a simple TyphoonAssembly that injects a property into a view controller. A single unit test has been added to validate the property is injected when the view controller is instantiated from the storyboard (this test validates the library can be linked to and DI works as expected)

In order to get the target to build properly, several headers needed UIKit (wrapped with `TARGET_OS_IPHONE`) and Foundation imports to compile properly.

Instructions for including dynamic framework in projects and apps (NOTE: until Cocoapods suppots dynamic frameworks, this tends to be the best way)
1. Include Typhoon as a git submodule
```
git submodule add https://github.com/typhoon-framework/Typhoon.git
```
2. Drag and drop the `Typhoon.xcodeproj` into the project navigator
3. Under your projects **Build Phases**, add the `Typhoon.framework` under the **Target Dependencies**
4. Under your projects **Build Phases**, click the **+** button and create a **New Copy Files Phase**
5. Name the new phase **Copy Frameworks**
6. Set the **destination** to **Frameworks**
7. Click the **+** and add `Typhoon.framework` to your new copy framework phase

![screen shot 2014-12-08 at 10 06 55 pm](https://cloud.githubusercontent.com/assets/4575216/5353058/b0b8b744-7f26-11e4-8536-c9048bce0695.png)

To use in a swift project (NOTE: you no longer need a bridging header :))
```
import Typhoon

public class Assembly: TyphoonAssembly {
public dynamic func viewController() -> AnyObject {
return TyphoonDefinition.withClass(ViewController.self) { definition in
definition.injectProperty("foo", with: "bar")
}
}
}
```