Created
March 11, 2017 22:01
-
-
Save Przemyslaw-Wosko/872821659f2ef7650989ab09be25d09f to your computer and use it in GitHub Desktop.
Swinject with storyboard usage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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