Typhoon. , Objective-C. "" :
: ApplicationAssembly.swift
public class ApplicationAssembly: TyphoonAssembly {
var coreComponents : CoreComponents!
var themeAssembly : ThemeAssembly!
public dynamic func weatherReportController() -> AnyObject {
return TyphoonDefinition.withClass(WeatherReportViewController.self) {
(definition) in
definition.useInitializer("initWithWeatherClient:weatherReportDao:cityDao:assembly:") {
(initializer) in
initializer.injectParameterWith(self.coreComponents.weatherClient())
initializer.injectParameterWith(self.coreComponents.weatherReportDao())
initializer.injectParameterWith(self.coreComponents.cityDao())
initializer.injectParameterWith(self)
}
};
}
public dynamic func addCityViewController() -> AnyObject {
return TyphoonDefinition.withClass(AddCityViewController.self) {
(definition) in
definition.useInitializer("initWithNibName:bundle:") {
(initializer) in
initializer.injectParameterWith("AddCity")
initializer.injectParameterWith(NSBundle.mainBundle())
}
definition.injectProperty("cityDao", with:self.coreComponents.cityDao())
definition.injectProperty("weatherClient", with:self.coreComponents.weatherClient())
definition.injectProperty("theme", with:self.themeAssembly.currentTheme())
definition.injectProperty("rootViewController", with:self.rootViewController())
}
}
}
Injection Dependency ( DI ), IDE. " " โโ(, , Swift, ).
:
, WeatherReportController CitiesListController, assembly.citiesListController. , Typhoon , , factory .
:
Typhoon .

Swift Objective-C ,
:
, .
unit test UIStoryboard "" ( setValue: forKey, . viewController UIStoryboard - "", )
.storyboard "instantiateViewControllerForStoryboardIdentifier" , .