Skip to content

Instantly share code, notes, and snippets.

@Przemyslaw-Wosko
Created March 11, 2017 22:01
Show Gist options
  • Select an option

  • Save Przemyslaw-Wosko/872821659f2ef7650989ab09be25d09f to your computer and use it in GitHub Desktop.

Select an option

Save Przemyslaw-Wosko/872821659f2ef7650989ab09be25d09f to your computer and use it in GitHub Desktop.
Swinject with storyboard usage
import Swinject
import SwinjectStoryboard
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
let container = Container()
var assembler : Assembler?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
Container.loggingFunction = nil // Turns off logging not registered view controllers
let assemblies : [Assembly] = [
StoryboardAssembly(),
UtilsAssembly(),
DispathersAssembly(),
LoginModule(),
DashboardModule(),
]
self.assembler = try! Assembler(assemblies: assemblies, container: container)
SwinjectStoryboard.defaultContainer = self.container
let dispather = container.resolve(ColdStartDispatcher.self)
dispather?.start(application, launchingArguments: launchOptions)
return true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment