Skip to content

Commit

Permalink
refactor: module factory로 화면전환 (TeamNADA#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlwns33 committed Mar 12, 2023
1 parent d4c1836 commit 0aa0197
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions NADA-iOS-forRelease/Sources/Factory/ModuleFactory.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import UIKit

protocol ModuleFactoryProtocol {
func makeSplashVC() -> SplashViewController
func makeAroundMeVC() -> AroundMeViewController
}

final class ModuleFactory: ModuleFactoryProtocol {
Expand All @@ -32,4 +33,12 @@ final class ModuleFactory: ModuleFactoryProtocol {
let splashVC = SplashViewController.controllerFromStoryboard(.splash)
return splashVC
}

func makeAroundMeVC() -> AroundMeViewController {
let viewModel = AroundMeViewModel()
let aroundMeVC = AroundMeViewController()
aroundMeVC.viewModel = viewModel
aroundMeVC.modalPresentationStyle = .overFullScreen
return aroundMeVC
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ final class HomeViewController: UIViewController {

// MARK: - Properties

private var moduleFactory = ModuleFactory.shared
private let disposeBag = DisposeBag()

// MARK: - UI Components
Expand Down Expand Up @@ -149,8 +150,7 @@ extension HomeViewController {
.withUnretained(self)
.bind { owner, _ in
owner.makeVibrate()
let aroundMeVC = AroundMeViewController()
aroundMeVC.modalPresentationStyle = .overFullScreen
let aroundMeVC = self.moduleFactory.makeAroundMeVC()
owner.present(aroundMeVC, animated: true)
}.disposed(by: self.disposeBag)
}
Expand Down

0 comments on commit 0aa0197

Please sign in to comment.