Skip to content

Commit 9df8f04

Browse files
committed
[BOOK-130] fix: reflect reviews
1 parent 59514bf commit 9df8f04

3 files changed

Lines changed: 18 additions & 28 deletions

File tree

src/Projects/BKPresentation/Sources/MainFlow/Home/HomeViewController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ final class HomeViewController: UIViewController {
3737
}
3838

3939
private func bindActions() {
40-
settingButton.addTarget(self, action: #selector(openInputCatalog), for: .touchUpInside)
40+
settingButton.addTarget(self, action: #selector(openSettings), for: .touchUpInside)
4141
}
4242

43-
@objc private func openInputCatalog() {
43+
@objc private func openSettings() {
4444
coordinator?.didTapSettingButton()
4545
}
4646
}

src/Projects/BKPresentation/Sources/MainFlow/Setting/View/SettingView.swift

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,7 @@ final class SettingView: BaseView {
2626
}
2727

2828
override func configure() {
29-
collectionView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
30-
collectionView.backgroundColor = .systemBackground
31-
collectionView.dataSource = self
32-
collectionView.delegate = self
33-
collectionView.isScrollEnabled = true
34-
collectionView.alwaysBounceVertical = true
35-
collectionView.register(
36-
SettingCell.self,
37-
forCellWithReuseIdentifier: SettingCell.identifier
38-
)
39-
collectionView.register(
40-
BKDividerFooterView.self,
41-
forSupplementaryViewOfKind: BKDividerFooterView.kind,
42-
withReuseIdentifier: BKDividerFooterView.identifier
43-
)
29+
configureCollectionView()
4430
}
4531

4632
override func setupLayout() {
@@ -60,6 +46,7 @@ final class SettingView: BaseView {
6046

6147
func setAppVersion(_ appVersion: String) {
6248
self.appVersion = appVersion
49+
collectionView.reloadData()
6350
}
6451
}
6552

@@ -90,11 +77,12 @@ private extension SettingView {
9077
}
9178

9279
func configureCollectionView() {
80+
collectionView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
9381
collectionView.backgroundColor = .systemBackground
94-
collectionView.dataSource = self
95-
collectionView.delegate = self
82+
collectionView.dataSource = self
83+
collectionView.delegate = self
84+
collectionView.isScrollEnabled = true
9685
collectionView.alwaysBounceVertical = true
97-
9886
collectionView.register(
9987
SettingCell.self,
10088
forCellWithReuseIdentifier: SettingCell.identifier
@@ -112,10 +100,10 @@ extension SettingView: UICollectionViewDelegate {
112100
_ collectionView: UICollectionView,
113101
didSelectItemAt indexPath: IndexPath
114102
) {
115-
if indexPath.section == 1 {
116-
if indexPath.item == 0 {
103+
if indexPath.section == Section.bottom.rawValue {
104+
if indexPath.item == Section.top.rawValue {
117105
eventPublisher.send(.logoutButtonTapped)
118-
} else if indexPath.item == 1 {
106+
} else if indexPath.item == Section.bottom.rawValue {
119107
eventPublisher.send(.withdrawalButtonTapped)
120108
}
121109
}
@@ -144,7 +132,9 @@ extension SettingView: UICollectionViewDataSource {
144132
_ collectionView: UICollectionView,
145133
numberOfItemsInSection section: Int
146134
) -> Int {
147-
return section == 0 ? firstMenus.count : secondMenus.count
135+
return section == Section.top.rawValue
136+
? firstMenus.count
137+
: secondMenus.count
148138
}
149139

150140
func collectionView(
@@ -158,14 +148,14 @@ extension SettingView: UICollectionViewDataSource {
158148
return UICollectionViewCell()
159149
}
160150

161-
let title: String = indexPath.section == 0
151+
let title: String = indexPath.section == Section.top.rawValue
162152
? firstMenus[indexPath.item].title
163153
: secondMenus[indexPath.item].title
164154

165155
switch (indexPath.section, indexPath.item) {
166-
case (0, 3):
156+
case (Section.top.rawValue, FirstMenuItem.allCases.count - 1):
167157
cell.configure(title: title, style: .label, appVersion: appVersion)
168-
case (1, _):
158+
case (Section.bottom.rawValue, _):
169159
cell.configure(title: title, style: .none)
170160
default:
171161
cell.configure(title: title, style: .chevron)

src/Projects/BKPresentation/Sources/MainFlow/Setting/ViewModel/SettingViewModel.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import Foundation
88
enum FirstMenuItem: String, CaseIterable {
99
case privacy = "개인정보 처리방침"
1010
case term = "이용약관"
11-
case lisence = "오픈소스 라이선스"
11+
case license = "오픈소스 라이선스"
1212
case version = "앱 버전"
1313

1414
var title: String { rawValue }

0 commit comments

Comments
 (0)