Skip to content

Commit

Permalink
Merge pull request #298 from boostcamp-2020/release
Browse files Browse the repository at this point in the history
v1.0.1 배포
  • Loading branch information
sihyungyou authored Dec 20, 2020
2 parents 3ec322a + b7ede7a commit 68fac4e
Showing 1 changed file with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ class CountryListViewController: UIViewController {
}
}

override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
checkPreviousData()
}

private func checkPreviousData() {
guard let countries = countryListViewModel?.countries else { return }

if countries.isEmpty {
let alertToast = Toast(text: "네트워크를 연결하고 앱을 재실행하세요", duration: Delay.short)
alertToast.show()
}
}

private func configureTableView() {
countryListTableView.delegate = self
countryListTableView.sectionIndexColor = UIColor(named: "mainColor")
Expand Down Expand Up @@ -76,12 +90,6 @@ class CountryListViewController: UIViewController {
}

private func applySnapShot(with countries: [CountryItemViewModel]) {
guard !countries.isEmpty else {
let alertToast = Toast(text: "네트워크를 연결하고 앱을 재실행하세요", duration: Delay.short)
alertToast.show()
return
}

var snapshot = SnapShot()
let sections = self.setupSection(with: countries)
snapshot.appendSections(sections)
Expand Down

0 comments on commit 68fac4e

Please sign in to comment.