Skip to content

Commit

Permalink
fix: adjust Example and README towards 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benjohnde committed Oct 17, 2019
1 parent e473c77 commit 7260a96
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 6 additions & 2 deletions DIKitExample/Sources/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
4 changes: 4 additions & 0 deletions DIKitExample/Sources/DependencyContainer+App.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ public extension DependencyContainer {
factory { LocalStorage() as LocalStorageProtocol }
}
}

struct Modules: DefinesContainer {
let container = modules { .app; .backend }
}
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
}
Expand Down

0 comments on commit 7260a96

Please sign in to comment.