Skip to content

Commit

Permalink
[Feat] sopt-makers#63- 뷰 연결 및 의존성 주입
Browse files Browse the repository at this point in the history
  • Loading branch information
devxsby committed Jan 1, 2023
1 parent d7d03e7 commit 5c75e09
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ public protocol ModuleFactoryInterface {
func makeRankingVC() -> RankingVC
func makeSettingVC() -> SettingVC
func makePasswordChangeVC() -> PasswordChangeVC
func makePrivacyPolicyVC() -> PrivacyPolicyVC
func makeTermsOfServiceVC() -> TermsOfServiceVC
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ extension SettingVC {
let passwordChangeVC = self.factory.makePasswordChangeVC()
navigationController?.pushViewController(passwordChangeVC, animated: true)
}

private func showPrivacyPolicyView() {
let privacyPolicyVC = self.factory.makePrivacyPolicyVC()
navigationController?.pushViewController(privacyPolicyVC, animated: true)
}

private func showTermsOfServieView() {
let termsOfServiceVC = self.factory.makeTermsOfServiceVC()
navigationController?.pushViewController(termsOfServiceVC, animated: true)
}
}

// MARK: - UI & Layout
Expand Down Expand Up @@ -117,9 +127,9 @@ extension SettingVC: UICollectionViewDelegate {
case 1:
switch indexPath.row {
case 0:
print("개인정보처리방침")
showPrivacyPolicyView()
case 1:
print("서비스 이용 약관")
showTermsOfServieView()
default:
print("서비스 의견 제안")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,16 @@ extension ModuleFactory: ModuleFactoryInterface {
passwordChangeVC.viewModel = viewModel
return passwordChangeVC
}

public func makePrivacyPolicyVC() -> Presentation.PrivacyPolicyVC {
let privacyPolicyVC = PrivacyPolicyVC()
privacyPolicyVC.factory = self
return privacyPolicyVC
}

public func makeTermsOfServiceVC() -> Presentation.TermsOfServiceVC {
let termsOfServiceVC = TermsOfServiceVC()
termsOfServiceVC.factory = self
return termsOfServiceVC
}
}

0 comments on commit 5c75e09

Please sign in to comment.