Skip to content

Commit

Permalink
feat: 버전 체크 후에 화면전환 메서드 구현 (#397)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyun99999 committed Apr 14, 2023
1 parent e306a6e commit 3979d34
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ final class HomeViewController: UIViewController {
setUI()
setLayout()
bindActions()
checkUpdateVersion()
}

}

extension HomeViewController {
Expand Down Expand Up @@ -169,6 +169,24 @@ extension HomeViewController {
return currentVersionArray[1] < appStoreVersionArray[1] ? true : false
}
}

private func checkUpdateVersion() {
updateUserInfoFetchWithAPI { [weak self] forceUpdateAgreement in
if !forceUpdateAgreement {
self?.updateNoteFetchWithAPI { [weak self] updateNote in
if self?.checkUpdateAvailable(updateNote.latestVersion) ?? false {
self?.presentToUpdateVC(with: updateNote)
}
}
}
}
}

private func presentToUpdateVC(with updateNote: UpdateNote?) {
let updateVC = ModuleFactory.shared.makeUpdateVC()
updateVC.updateNote = updateNote
self.present(updateVC, animated: true)
}
}

// MARK: - Network
Expand Down

0 comments on commit 3979d34

Please sign in to comment.