Skip to content

Commit

Permalink
[Refactor] Detail Coordinator 세팅 DO-SOPT-iOS-Part#20
Browse files Browse the repository at this point in the history
  • Loading branch information
HELLOHIDI committed Jul 5, 2024
1 parent ac8ea4b commit 4666619
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 52 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//
// DetailFeatureViewBuildable.swift
// DetailFeatureInterface
//
// Created by 류희재 on 7/5/24.
// Copyright © 2024 Weather-iOS. All rights reserved.
//

import Core

public protocol DetailFeatureViewBuildable {
func makeDetail() -> DetailPresentable
}

Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
//
// DetailPresentable.swift
// DetailFeatureManifests
// DetailFeatureInterface
//
// Created by 류희재 on 6/28/24.
// Created by 류희재 on 7/5/24.
// Copyright © 2024 Weather-iOS. All rights reserved.
//

import Foundation

import BaseFeatureDependency
import Core

public protocol DetailViewControllable: ViewControllable { }
public protocol DetailCoordinatable {}

public typealias DetailViewModelType = ViewModelType & DetailCoordinatable
public typealias DetailPresentable = (vc: DetailViewControllable, vm: any DetailViewModelType)


This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
//
// DetailBuilder.swift
// DetailFeatureInterface
//
// Created by 류희재 on 7/5/24.
// Copyright © 2024 Weather-iOS. All rights reserved.
//

import Core
import Domain

import DetailFeatureInterface

public
final class DetailBuilder {
public var repository: WeatherRepository

public init(repository: WeatherRepository) {
self.repository = repository
}
}

extension DetailBuilder: DetailFeatureViewBuildable {
public func makeMain() -> DetailPresentable {
let useCase = DefaultMainUseCase(repository: repository)
let vm = DetailViewModel(mainUseCase: useCase)
let vc = DetailViewController(viewModel: vm)
vc.viewModel = vm
return (vc, vm)
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// DetailCoordinator.swift
// DetailFeatureInterface
//
// Created by 류희재 on 7/5/24.
// Copyright © 2024 Weather-iOS. All rights reserved.
//

import BaseFeatureDependency
import Core

public enum DetailCoordinatorDestination {
case detail
}
public protocol DetailCoordinatorOutput {
var requestCoordinating: ((DetailCoordinatorDestination) -> Void)? { get set }
}
public typealias DefaultDetailCoordinator = BaseCoordinator & DetailCoordinatorOutput

public
final class DetailCoordinator: DefaultDetailCoordinator {

public var requestCoordinating: ((DetailCoordinatorDestination) -> Void)?

private let factory: DetailFeatureViewBuildable
private let router: Router

public init(router: Router, factory: DetailFeatureViewBuildable) {
self.factory = factory
self.router = router
}

public override func start() {
var main = factory.makeDetail()

}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import Domain

import RxSwift
import RxCocoa
import BaseFeatureDependency

public final class DetailViewModel {
public final class DetailViewModel: DetailViewModelType {
internal var disposeBag = DisposeBag()

public let detailUseCase: DetailUseCase
Expand Down

0 comments on commit 4666619

Please sign in to comment.