-
Notifications
You must be signed in to change notification settings - Fork 1
[Refactor-T3-182] 마이페이지, 설정 V2디자인 반영. 강제 업데이트 구현 #57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| { | ||
| "images" : [ | ||
| { | ||
| "filename" : "bitnagil_chevron_icon@1x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "1x" | ||
| }, | ||
| { | ||
| "filename" : "bitnagil_chevron_icon@2x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "2x" | ||
| }, | ||
| { | ||
| "filename" : "bitnagil_chevron_icon@3x.png", | ||
| "idiom" : "universal", | ||
| "scale" : "3x" | ||
| } | ||
| ], | ||
| "info" : { | ||
| "author" : "xcode", | ||
| "version" : 1 | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -103,6 +103,7 @@ final class HomeViewController: BaseViewController<HomeViewModel> { | |
| super.viewDidLoad() | ||
| showIndicatorView() | ||
| viewModel.action(input: .loadNickname) | ||
| viewModel.action(input: .fetchVersion) | ||
| } | ||
|
|
||
| override func viewWillAppear(_ animated: Bool) { | ||
|
|
@@ -461,6 +462,35 @@ final class HomeViewController: BaseViewController<HomeViewModel> { | |
| self?.weekView.updateAllCompletedState(allCompletedDates: allCompletedDates) | ||
| } | ||
| .store(in: &cancellables) | ||
|
|
||
| viewModel.output.updateVersionPublisher | ||
| .receive(on: DispatchQueue.main) | ||
| .sink { [weak self] updateURL in | ||
| guard let updateURL else { return } | ||
|
|
||
| let alert = UIAlertController( | ||
| title: "업데이트가 필요합니다", | ||
| message: "원활한 이용을 위해, 빛나길을 업데이트 해주세요!", | ||
| preferredStyle: .alert) | ||
|
|
||
| let cancel = UIAlertAction( | ||
| title: "취소", | ||
| style: .default, | ||
| handler: { _ in exit(0) }) | ||
|
|
||
| let update = UIAlertAction( | ||
| title: "업데이트", | ||
| style: .default, | ||
| handler: { _ in | ||
| UIApplication.shared.open(updateURL, options: [:], completionHandler: { _ in exit(0) }) | ||
| }) | ||
|
Comment on lines
+485
to
+486
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 딩이 강종이 심사 리젝 사유라고 해가주구 생각해봤는데욤 ... 그냥 검정 화면 혹은 빈 화면을 띄우는건 어떤지 ??
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 아하 앱에 다시 돌아왔을때 빈 화면만 보여주자는 말씀이신가요??
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 네네네 !!!!!! 만약 리젝 된다면 .. ㅎㅎㅎㅎㅎ
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 조아요 꼼수더라도 일단 우회 고~! |
||
|
|
||
| alert.addAction(cancel) | ||
| alert.addAction(update) | ||
| alert.preferredAction = update | ||
| self?.present(alert, animated: true) | ||
| } | ||
| .store(in: &cancellables) | ||
| } | ||
|
|
||
| // 해당 날짜의 Routine View를 설정합니다. (없다면 EmptyView) | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,6 +20,7 @@ final class HomeViewModel: ViewModel { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case fetchDailyRoutine | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case refreshDailyRoutine | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case updateRoutineCompletion(updatedRoutine: Routine) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case fetchVersion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| struct Output { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -31,6 +32,7 @@ final class HomeViewModel: ViewModel { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let routinesPublisher: AnyPublisher<[Routine], Never> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let updateRoutineCompletionResultPublisher: AnyPublisher<Bool, Never> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let allCompletedRoutineDatePublisher: AnyPublisher<[Date], Never> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let updateVersionPublisher: AnyPublisher<URL?, Never> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private(set) var output: Output | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -45,6 +47,7 @@ final class HomeViewModel: ViewModel { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private let selectedRoutineSubject = CurrentValueSubject<Routine?, Never>(nil) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private let updateRoutineCompletionResultSubject = PassthroughSubject<Bool, Never>() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private let allCompletedRoutineDateSubject = CurrentValueSubject<[Date], Never>([]) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private let updateVersionSubject = PassthroughSubject<URL?, Never>() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private let calendar = Calendar.current | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private let today = Date() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -54,14 +57,18 @@ final class HomeViewModel: ViewModel { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private let routineUseCase: RoutineUseCaseProtocol | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private let userDataUseCase: UserDataUseCaseProtocol | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private let emotionUseCase: EmotionUseCaseProtocol | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private let appConfigRepository: AppConfigRepositoryProtocol | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| init( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| routineUseCase: RoutineUseCaseProtocol, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| userDataUseCase: UserDataUseCaseProtocol, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| emotionUseCase: EmotionUseCaseProtocol | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| emotionUseCase: EmotionUseCaseProtocol, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| appConfigRepository: AppConfigRepositoryProtocol | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.routineUseCase = routineUseCase | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.userDataUseCase = userDataUseCase | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.emotionUseCase = emotionUseCase | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.appConfigRepository = appConfigRepository | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| self.output = Output( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| nicknamePublisher: nicknameSubject.eraseToAnyPublisher(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| emotionPublisher: emotionSubject.eraseToAnyPublisher(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -70,7 +77,8 @@ final class HomeViewModel: ViewModel { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fetchRoutineResultPublisher: fetchRoutineResultSubject.eraseToAnyPublisher(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| routinesPublisher: routinesSubject.eraseToAnyPublisher(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| updateRoutineCompletionResultPublisher: updateRoutineCompletionResultSubject.eraseToAnyPublisher(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| allCompletedRoutineDatePublisher: allCompletedRoutineDateSubject.eraseToAnyPublisher()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| allCompletedRoutineDatePublisher: allCompletedRoutineDateSubject.eraseToAnyPublisher(), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| updateVersionPublisher: updateVersionSubject.eraseToAnyPublisher()) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| func action(input: Input) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -102,6 +110,9 @@ final class HomeViewModel: ViewModel { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case .refreshDailyRoutine: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| refreshSelectedDateRoutines() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| case .fetchVersion: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| checkVersion() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -262,4 +273,26 @@ final class HomeViewModel: ViewModel { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| private func checkVersion() { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let major = currentVersion?.split(separator: ".").first | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Task { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| do { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let appStoreAppVersion = try await appConfigRepository.fetchAppVersion() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let appStoreMajor = appStoreAppVersion?.split(separator: ".").first | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if major != appStoreMajor { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| let url = URL(string: "itms-apps://itunes.apple.com/app/id6749437799") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| updateVersionSubject.send(url) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| updateVersionSubject.send(nil) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } catch { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+277
to
+297
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chain버전 비교 로직의 nil/파싱 예외 처리 보강 및 실패 시 안전 동작 필요 현재는 옵셔널 비교와 에러 삼키기 때문에, 일시적 네트워크/파싱 실패에도 ‘강제 업데이트’로 오인될 위험이 있습니다. 실패 시에는 업데이트 미필요로 처리하고, 비교값은 확정적으로 언랩해 주세요. - private func checkVersion() {
- let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
- let major = currentVersion?.split(separator: ".").first
-
- Task {
- do {
- let appStoreAppVersion = try await appConfigRepository.fetchAppVersion()
- let appStoreMajor = appStoreAppVersion?.split(separator: ".").first
-
- if major != appStoreMajor {
- let url = URL(string: "itms-apps://itunes.apple.com/app/id6749437799")
- updateVersionSubject.send(url)
- } else {
- updateVersionSubject.send(nil)
- }
-
- } catch {
-
- }
- }
- }
+ private func checkVersion() {
+ guard
+ let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String,
+ let currentMajor = currentVersion.split(separator: ".").first
+ else {
+ updateVersionSubject.send(nil)
+ return
+ }
+
+ Task {
+ do {
+ guard
+ let appStoreVersion = try await appConfigRepository.fetchAppVersion(),
+ let appStoreMajor = appStoreVersion.split(separator: ".").first
+ else {
+ updateVersionSubject.send(nil)
+ return
+ }
+
+ if currentMajor != appStoreMajor {
+ let url = URL(string: "itms-apps://itunes.apple.com/app/id6749437799")
+ updateVersionSubject.send(url)
+ } else {
+ updateVersionSubject.send(nil)
+ }
+ } catch {
+ updateVersionSubject.send(nil)
+ }
+ }
+ }보완 포인트:
🏁 Script executed: #!/bin/bash
# SettingViewModel의 버전 비교 기준 확인
rg -nP 'SettingViewModel' -n --type swift -C3
rg -nP 'fetchVersion\(\)|versionSubject|needUpdate|latest' -n --type swift -C3Length of output: 13336 버전 비교 로직 nil/파싱 예외 처리 강화 및 비교 기준 통합 검토
private func checkVersion() {
- let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String
- let major = currentVersion?.split(separator: ".").first
+ guard
+ let currentVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String,
+ let currentMajor = currentVersion.split(separator: ".").first
+ else {
+ updateVersionSubject.send(nil)
+ return
+ }
Task {
do {
- let appStoreAppVersion = try await appConfigRepository.fetchAppVersion()
- let appStoreMajor = appStoreAppVersion?.split(separator: ".").first
+ guard
+ let appStoreVersion = try await appConfigRepository.fetchAppVersion(),
+ let appStoreMajor = appStoreVersion.split(separator: ".").first
+ else {
+ updateVersionSubject.send(nil)
+ return
+ }
if currentMajor != appStoreMajor {
let url = URL(string: "itms-apps://itunes.apple.com/app/id6749437799")
updateVersionSubject.send(url)
} else {
updateVersionSubject.send(nil)
}
} catch {
-
+ updateVersionSubject.send(nil)
}
}
}📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -14,7 +14,7 @@ import UIKit | |||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| final class SettingView: BaseViewController<SettingViewModel> { | ||||||||||||||||||||||||||||||||||||||||||
| private enum Layout { | ||||||||||||||||||||||||||||||||||||||||||
| static let tableViewTopSpacing: CGFloat = 32 | ||||||||||||||||||||||||||||||||||||||||||
| static let tableViewTopSpacing: CGFloat = 80 | ||||||||||||||||||||||||||||||||||||||||||
| static let tableViewHeaderHeight: CGFloat = 48 | ||||||||||||||||||||||||||||||||||||||||||
| static let tableViewRowHeight: CGFloat = 48 | ||||||||||||||||||||||||||||||||||||||||||
| static let tableViewFooterHeight: CGFloat = .zero | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -110,7 +110,8 @@ final class SettingView: BaseViewController<SettingViewModel> { | |||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| override func viewWillAppear(_ animated: Bool) { | ||||||||||||||||||||||||||||||||||||||||||
| super.viewWillAppear(animated) | ||||||||||||||||||||||||||||||||||||||||||
| // configureNavigationBar(navigationStyle: .withBackButton(title: "설정")) | ||||||||||||||||||||||||||||||||||||||||||
| navigationController?.navigationBar.isHidden = true | ||||||||||||||||||||||||||||||||||||||||||
| configureCustomNavigationBar(navigationBarStyle: .withBackButton(title: "설정")) | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
111
to
115
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion viewWillAppear에서 커스텀 네비게이션 바를 매번 추가 — 중복 추가 위험
final class SettingView: BaseViewController<SettingViewModel> {
+ private var didAddCustomNavigationBar = Bool(false)
...
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
navigationController?.navigationBar.isHidden = true
- configureCustomNavigationBar(navigationBarStyle: .withBackButton(title: "설정"))
+ if !didAddCustomNavigationBar {
+ configureCustomNavigationBar(navigationBarStyle: .withBackButton(title: "설정"))
+ didAddCustomNavigationBar = true
+ }
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| override func configureAttribute() { | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -134,10 +135,14 @@ final class SettingView: BaseViewController<SettingViewModel> { | |||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| override func configureLayout() { | ||||||||||||||||||||||||||||||||||||||||||
| let safeArea = view.safeAreaLayoutGuide | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| view.addSubview(tableView) | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| tableView.snp.makeConstraints { make in | ||||||||||||||||||||||||||||||||||||||||||
| make.edges.horizontalEdges.equalToSuperview() | ||||||||||||||||||||||||||||||||||||||||||
| make.top.equalTo(safeArea.snp.top).offset(Layout.tableViewTopSpacing) | ||||||||||||||||||||||||||||||||||||||||||
| make.horizontalEdges.equalToSuperview() | ||||||||||||||||||||||||||||||||||||||||||
| make.bottom.equalTo(safeArea.snp.bottom) | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -337,9 +342,8 @@ extension SettingView: UITableViewDataSource { | |||||||||||||||||||||||||||||||||||||||||
| // view.backgroundColor = .white | ||||||||||||||||||||||||||||||||||||||||||
| // return view | ||||||||||||||||||||||||||||||||||||||||||
| case .information: | ||||||||||||||||||||||||||||||||||||||||||
| let view = UIView() | ||||||||||||||||||||||||||||||||||||||||||
| view.backgroundColor = .white | ||||||||||||||||||||||||||||||||||||||||||
| return view | ||||||||||||||||||||||||||||||||||||||||||
| headerView.configure(shouldShowDivider: false, title: section.title) | ||||||||||||||||||||||||||||||||||||||||||
| return headerView | ||||||||||||||||||||||||||||||||||||||||||
| default: | ||||||||||||||||||||||||||||||||||||||||||
| headerView.configure(shouldShowDivider: true, title: section.title) | ||||||||||||||||||||||||||||||||||||||||||
| return headerView | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
버전 체크 트리거 위치 재고 필요(백그라운드 복귀 시 재검 없음)
viewDidLoad한 번만 호출되므로, 사용자가 App Store 다녀온 뒤 앱으로 복귀해도 재검이 실행되지 않습니다.viewWillAppear추가 트리거 또는willEnterForeground노티 관찰을 권장합니다.예시(선택, 변경은 파일 범위 밖):
🤖 Prompt for AI Agents