Skip to content

Commit

Permalink
feat: InputParticipateCode Interface, Implement 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
hope1053 committed Jul 3, 2023
1 parent f4dad0c commit 55d040b
Show file tree
Hide file tree
Showing 9 changed files with 63 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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<InputParticipateCodeDependency> {
public protocol InputParticipateCodeDependency: Dependency { }

// TODO: Declare 'fileprivate' dependencies that are only used by this RIB.
}
final class InputParticipateCodeComponent: Component<InputParticipateCodeDependency> { }

// MARK: - Builder

protocol InputParticipateCodeBuildable: Buildable {
func build(withListener listener: InputParticipateCodeListener) -> InputParticipateCodeRouting
}

final class InputParticipateCodeBuilder: Builder<InputParticipateCodeDependency>, InputParticipateCodeBuildable {
public final class InputParticipateCodeBuilder: Builder<InputParticipateCodeDependency>, 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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
Expand All @@ -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<InputParticipateCodePresentable>, InputParticipateCodeInteractable, InputParticipateCodePresentableListener {

weak var router: InputParticipateCodeRouting?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

import RIBs

import MOITParticipateUserInterface

protocol InputParticipateCodeInteractable: Interactable {
var router: InputParticipateCodeRouting? { get set }
var listener: InputParticipateCodeListener? { get set }
Expand Down
Original file line number Diff line number Diff line change
@@ -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
}
Original file line number Diff line number Diff line change
@@ -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 { }

This file was deleted.

This file was deleted.

0 comments on commit 55d040b

Please sign in to comment.