From 7260a965baa8eae0d2686578932ed0583830d3f5 Mon Sep 17 00:00:00 2001 From: Ben John Date: Thu, 17 Oct 2019 13:49:05 +0200 Subject: [PATCH] fix: adjust Example and README towards 1.3.0 --- DIKitExample/Sources/AppDelegate.swift | 8 ++++++-- DIKitExample/Sources/DependencyContainer+App.swift | 4 ++++ README.md | 6 ++++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/DIKitExample/Sources/AppDelegate.swift b/DIKitExample/Sources/AppDelegate.swift index 5029272..542153c 100644 --- a/DIKitExample/Sources/AppDelegate.swift +++ b/DIKitExample/Sources/AppDelegate.swift @@ -13,7 +13,11 @@ import DIKit import DIKitExampleBackend @UIApplicationMain -class AppDelegate: UIResponder, UIApplicationDelegate, DefinesContainer { +class AppDelegate: UIResponder, UIApplicationDelegate { var window: UIWindow? - let container = modules { .app; .backend } + + override init() { + super.init() + DependencyContainer.defined(by: Modules()) + } } diff --git a/DIKitExample/Sources/DependencyContainer+App.swift b/DIKitExample/Sources/DependencyContainer+App.swift index d92fdf8..65988bc 100644 --- a/DIKitExample/Sources/DependencyContainer+App.swift +++ b/DIKitExample/Sources/DependencyContainer+App.swift @@ -15,3 +15,7 @@ public extension DependencyContainer { factory { LocalStorage() as LocalStorageProtocol } } } + +struct Modules: DefinesContainer { + let container = modules { .app; .backend } +} diff --git a/README.md b/README.md index cd975e8..cb44db8 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,10 @@ struct Modules: DefinesContainer { let container = modules { .backend; .network } } -class ApplicationLayer { - public onBootstrap() { +@UIApplicationMain +class AppDelegate: UIApplicationDelegate { + override init() { + super.init() DependencyContainer.defined(by: Modules()) } }