Skip to content

Commit

Permalink
✨ :: [#123] App / ProposeMusic DI
Browse files Browse the repository at this point in the history
  • Loading branch information
baekteun committed Jul 27, 2023
1 parent 656216f commit ce100d0
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Projects/App/Sources/Application/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import MyViolationListFeature
import Networking
import NoticeDomain
import NoticeFeature
import ProposeMusicFeature
import RenewalPasswordFeature
import RootFeature
import SelfStudyDomain
Expand Down Expand Up @@ -50,6 +51,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
SelfStudyAssembly(),
ConfirmationDialogAssembly(),
MassageAssembly(),
ProposeMusicAssembly(),
MusicAssembly(),
MainAssembly(),
SigninAssembly(),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import MusicDomainInterface
import Swinject

public final class ProposeMusicAssembly: Assembly {
public init() {}
public func assemble(container: Container) {
container.register(ProposeMusicFactory.self) { resolver in
ProposeMusicFactoryImpl(
proposeMusicUseCase: resolver.resolve(ProposeMusicUseCase.self)!
)
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import BaseFeature
import UIKit

public protocol ProposeMusicFactory {
func makeViewController() -> any StoredViewControllable
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import BaseFeature
import MusicDomainInterface
import UIKit

struct ProposeMusicFactoryImpl: ProposeMusicFactory {
private let proposeMusicUseCase: any ProposeMusicUseCase

init(proposeMusicUseCase: any ProposeMusicUseCase) {
self.proposeMusicUseCase = proposeMusicUseCase
}

func makeViewController() -> any StoredViewControllable {
let store = ProposeMusicStore(
proposeMusicUseCase: proposeMusicUseCase
)
return ProposeMusicViewController(store: store)
}
}

0 comments on commit ce100d0

Please sign in to comment.