diff --git a/ByeBoo-iOS/ByeBoo-iOS/Data/DataDependencyAssembler.swift b/ByeBoo-iOS/ByeBoo-iOS/Data/DataDependencyAssembler.swift index d5393fbd..7a138f6f 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Data/DataDependencyAssembler.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Data/DataDependencyAssembler.swift @@ -71,6 +71,14 @@ struct DataDependencyAssembler: DependencyAssembler { DIContainer.shared.register(type: NotificationInterface.self) { _ in return DefaultNotificationRepository(networkService: networkService) } + + DIContainer.shared.register(type: DefaultNotificationTokenRepository.self) { _ in + return DefaultNotificationTokenRepository( + network: networkService, + userDefaultsService: userDefaultService, + keychainService: keychainService + ) + } } } diff --git a/ByeBoo-iOS/ByeBoo-iOS/Domain/Interface/NotificationTokenInterface.swift b/ByeBoo-iOS/ByeBoo-iOS/Domain/Interface/NotificationTokenInterface.swift index 3c92561a..5e0c0d62 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Domain/Interface/NotificationTokenInterface.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Domain/Interface/NotificationTokenInterface.swift @@ -1,5 +1,5 @@ // -// NotificationInterface.swift +// NotificationTokenInterface.swift // ByeBoo-iOS // // Created by APPLE on 11/26/25. diff --git a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewController/NotificationsViewController.swift b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewController/NotificationsViewController.swift index cc0cc1b4..c1e36441 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewController/NotificationsViewController.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewController/NotificationsViewController.swift @@ -36,11 +36,8 @@ final class NotificationsViewController: BaseViewController { action: #selector(back) ) - guard let notifications = notificationList?.notifications else { - return - } - - rootView.contentView.decideNoticeContent(isExistNotice: !notifications.isEmpty) + let isExistNotice = notificationList.map { !$0.notifications.isEmpty } ?? false + rootView.contentView.decideNoticeContent(isExistNotice: isExistNotice) } override func setAddTarget() { diff --git a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewModel/NotificationsViewModel.swift b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewModel/NotificationsViewModel.swift index 6c3d8997..d43f50a1 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewModel/NotificationsViewModel.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Home/ViewModel/NotificationsViewModel.swift @@ -14,10 +14,6 @@ final class NotificationsViewModel { } func formatElapsedTime(from timeString: String) -> String? { - guard let formattedTime = formatElapsedTimeUseCase.execute(from: timeString) else { - return nil - } - - return formattedTime + formatElapsedTimeUseCase.execute(from: timeString) } } diff --git a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Quest/ViewModel/CommonQuestViewModel.swift b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Quest/ViewModel/CommonQuestViewModel.swift index a196aec7..99a5f428 100644 --- a/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Quest/ViewModel/CommonQuestViewModel.swift +++ b/ByeBoo-iOS/ByeBoo-iOS/Presentation/Feature/Quest/ViewModel/CommonQuestViewModel.swift @@ -129,6 +129,7 @@ extension CommonQuestViewModel { } func getWrittenAt(at index: Int) -> String? { - formatElapsedTimeUseCase.execute(from: answers[index].writtenAt) + guard index >= 0 && index < answers.count else { return nil } + return formatElapsedTimeUseCase.execute(from: answers[index].writtenAt) } }