diff --git a/Features/MOITParticipate/MOITParticipateUserInterface/DemoApp/Sources/MOITParticipateUserInterfaceAppDelegate.swift b/Features/MOITParticipate/MOITParticipateUserInterface/DemoApp/Sources/MOITParticipateUserInterfaceAppDelegate.swift index a4a29824..09db4752 100644 --- a/Features/MOITParticipate/MOITParticipateUserInterface/DemoApp/Sources/MOITParticipateUserInterfaceAppDelegate.swift +++ b/Features/MOITParticipate/MOITParticipateUserInterface/DemoApp/Sources/MOITParticipateUserInterfaceAppDelegate.swift @@ -8,15 +8,37 @@ import UIKit +import MOITParticipateUserInterface +import MOITParticipateUserInterfaceImpl + +import RIBs + @main final class MOITParticipateAppDelegate: UIResponder, UIApplicationDelegate { + + private final class MockMOITParticipateDependency: InputParticipateCodeDependency { } + + private final class MockMOITPariticipateListener: InputParticipateCodeListener { } + var window: UIWindow? - func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UINavigationController(rootViewController: MOITParticipateUserInterfaceViewController()) - window.makeKeyAndVisible() - self.window = window - return true - } + private var router: ViewableRouting? + + func application( + _ application: UIApplication, + didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? + ) -> Bool { + let window = UIWindow(frame: UIScreen.main.bounds) + + router = InputParticipateCodeBuilder(dependency: MockMOITParticipateDependency()) + .build(withListener: MockMOITPariticipateListener()) + router?.load() + router?.interactable.activate() + + window.rootViewController = self.router?.viewControllable.uiviewController + window.makeKeyAndVisible() + self.window = window + + return true + } } diff --git a/Features/MOITParticipate/MOITParticipateUserInterface/DemoApp/Sources/MOITParticipateUserInterfaceViewController.swift b/Features/MOITParticipate/MOITParticipateUserInterface/DemoApp/Sources/MOITParticipateUserInterfaceViewController.swift deleted file mode 100644 index 807099cc..00000000 --- a/Features/MOITParticipate/MOITParticipateUserInterface/DemoApp/Sources/MOITParticipateUserInterfaceViewController.swift +++ /dev/null @@ -1,66 +0,0 @@ -// -// ViewController.swift -// -// MOIT -// -// Created by hyerin on . -// - -import UIKit - -import MOITParticipateUserInterfaceImpl - -fileprivate enum MOITParticipateType: String, - CaseIterable { - case inputCode - case particiaptionSuccess -} - -final class MOITParticipateUserInterfaceViewController: UITableViewController { - - private var moitParticipateTypes: [MOITParticipateType] = MOITParticipateType.allCases - - override func viewDidLoad() { - super.viewDidLoad() - self.view.backgroundColor = .white - - self.tableView.register(UITableViewCell.self, forCellReuseIdentifier: "cell") - } - - override func tableView( - _ tableView: UITableView, - numberOfRowsInSection section: Int - ) -> Int { - moitParticipateTypes.count - } - - override func tableView( - _ tableView: UITableView, - cellForRowAt indexPath: IndexPath - ) -> UITableViewCell { - let cell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath) - cell.textLabel?.text = self.moitParticipateTypes[indexPath.item].rawValue - return cell - } - - override func tableView( - _ tableView: UITableView, - heightForRowAt indexPath: IndexPath - ) -> CGFloat { - return 50 - } - - override func tableView( - _ tableView: UITableView, - didSelectRowAt indexPath: IndexPath - ) { - let moitParticipateType = self.moitParticipateTypes[indexPath.item] - switch moitParticipateType { - case .inputCode: - self.navigationController?.pushViewController(InputParticipateCodeViewController(), animated: true) - case .particiaptionSuccess: - break - } - } -} - diff --git a/Features/MOITParticipate/MOITParticipateUserInterface/Implement/InputParticipateCodeBuilder.swift b/Features/MOITParticipate/MOITParticipateUserInterface/Implement/InputParticipateCodeBuilder.swift index cd27a876..af5f5b57 100644 --- a/Features/MOITParticipate/MOITParticipateUserInterface/Implement/InputParticipateCodeBuilder.swift +++ b/Features/MOITParticipate/MOITParticipateUserInterface/Implement/InputParticipateCodeBuilder.swift @@ -8,29 +8,21 @@ import RIBs -protocol InputParticipateCodeDependency: Dependency { - // TODO: Declare the set of dependencies required by this RIB, but cannot be - // created by this RIB. -} +import MOITParticipateUserInterface -final class InputParticipateCodeComponent: Component { +public protocol InputParticipateCodeDependency: Dependency { } - // TODO: Declare 'fileprivate' dependencies that are only used by this RIB. -} +final class InputParticipateCodeComponent: Component { } // MARK: - Builder -protocol InputParticipateCodeBuildable: Buildable { - func build(withListener listener: InputParticipateCodeListener) -> InputParticipateCodeRouting -} - -final class InputParticipateCodeBuilder: Builder, InputParticipateCodeBuildable { +public final class InputParticipateCodeBuilder: Builder, InputParticipateCodeBuildable { - override init(dependency: InputParticipateCodeDependency) { + override public init(dependency: InputParticipateCodeDependency) { super.init(dependency: dependency) } - func build(withListener listener: InputParticipateCodeListener) -> InputParticipateCodeRouting { + public func build(withListener listener: InputParticipateCodeListener) -> ViewableRouting { let component = InputParticipateCodeComponent(dependency: dependency) let viewController = InputParticipateCodeViewController() let interactor = InputParticipateCodeInteractor(presenter: viewController) diff --git a/Features/MOITParticipate/MOITParticipateUserInterface/Implement/InputParticipateCodeInteractor.swift b/Features/MOITParticipate/MOITParticipateUserInterface/Implement/InputParticipateCodeInteractor.swift index 0f80b58a..58ade22a 100644 --- a/Features/MOITParticipate/MOITParticipateUserInterface/Implement/InputParticipateCodeInteractor.swift +++ b/Features/MOITParticipate/MOITParticipateUserInterface/Implement/InputParticipateCodeInteractor.swift @@ -9,6 +9,8 @@ import RIBs import RxSwift +import MOITParticipateUserInterface + protocol InputParticipateCodeRouting: ViewableRouting { // TODO: Declare methods the interactor can invoke to manage sub-tree via the router. } @@ -18,10 +20,6 @@ protocol InputParticipateCodePresentable: Presentable { // TODO: Declare methods the interactor can invoke the presenter to present data. } -protocol InputParticipateCodeListener: AnyObject { - // TODO: Declare methods the interactor can invoke to communicate with other RIBs. -} - final class InputParticipateCodeInteractor: PresentableInteractor, InputParticipateCodeInteractable, InputParticipateCodePresentableListener { weak var router: InputParticipateCodeRouting? diff --git a/Features/MOITParticipate/MOITParticipateUserInterface/Implement/InputParticipateCodeRouter.swift b/Features/MOITParticipate/MOITParticipateUserInterface/Implement/InputParticipateCodeRouter.swift index 3310d10e..28741883 100644 --- a/Features/MOITParticipate/MOITParticipateUserInterface/Implement/InputParticipateCodeRouter.swift +++ b/Features/MOITParticipate/MOITParticipateUserInterface/Implement/InputParticipateCodeRouter.swift @@ -8,6 +8,8 @@ import RIBs +import MOITParticipateUserInterface + protocol InputParticipateCodeInteractable: Interactable { var router: InputParticipateCodeRouting? { get set } var listener: InputParticipateCodeListener? { get set } diff --git a/Features/MOITParticipate/MOITParticipateUserInterface/Interface/InputParticipateCode/InputParticipateCodeBuildable.swift b/Features/MOITParticipate/MOITParticipateUserInterface/Interface/InputParticipateCode/InputParticipateCodeBuildable.swift new file mode 100644 index 00000000..a1913f2a --- /dev/null +++ b/Features/MOITParticipate/MOITParticipateUserInterface/Interface/InputParticipateCode/InputParticipateCodeBuildable.swift @@ -0,0 +1,13 @@ +// +// InputParticipateCodeBuildable.swift +// MOITParticipateUserInterface +// +// Created by 최혜린 on 2023/07/03. +// Copyright © 2023 chansoo.MOIT. All rights reserved. +// + +import RIBs + +public protocol InputParticipateCodeBuildable: Buildable { + func build(withListener listener: InputParticipateCodeListener) -> ViewableRouting +} diff --git a/Features/MOITParticipate/MOITParticipateUserInterface/Interface/InputParticipateCode/InputParticipateCodeListener.swift b/Features/MOITParticipate/MOITParticipateUserInterface/Interface/InputParticipateCode/InputParticipateCodeListener.swift new file mode 100644 index 00000000..433be001 --- /dev/null +++ b/Features/MOITParticipate/MOITParticipateUserInterface/Interface/InputParticipateCode/InputParticipateCodeListener.swift @@ -0,0 +1,11 @@ +// +// InputParticipateCodeListener.swift +// MOITParticipateUserInterface +// +// Created by 최혜린 on 2023/07/03. +// Copyright © 2023 chansoo.MOIT. All rights reserved. +// + +import RIBs + +public protocol InputParticipateCodeListener: AnyObject { } diff --git a/Features/MOITParticipate/MOITParticipateUserInterface/Interface/MOITParticipateInterface.swift b/Features/MOITParticipate/MOITParticipateUserInterface/Interface/MOITParticipateInterface.swift deleted file mode 100644 index 3051fd4d..00000000 --- a/Features/MOITParticipate/MOITParticipateUserInterface/Interface/MOITParticipateInterface.swift +++ /dev/null @@ -1,9 +0,0 @@ -// -// MOITParticipateInterface.swift -// MOITParticipateUserInterface -// -// Created by 최혜린 on 2023/06/16. -// Copyright © 2023 chansoo.MOIT. All rights reserved. -// - -import Foundation diff --git a/Features/MOITParticipate/MOITParticipateUserInterface/Interface/dummy.swift b/Features/MOITParticipate/MOITParticipateUserInterface/Interface/dummy.swift deleted file mode 100644 index 9997fb44..00000000 --- a/Features/MOITParticipate/MOITParticipateUserInterface/Interface/dummy.swift +++ /dev/null @@ -1,4 +0,0 @@ -// -// dummy.swift -// -