Skip to content

Commit

Permalink
[Feat/#83] 답장 조회 시 읽음 여부 변수 DTO 추가 및 isNew 변수 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
Nya128 committed Sep 5, 2024
1 parent 49aaebc commit b0075d8
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 54 deletions.
12 changes: 0 additions & 12 deletions Clody_iOS/Clody_iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@
95310FA62C41D97E00023C7B /* SplashViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95310FA52C41D97E00023C7B /* SplashViewController.swift */; };
95310FAB2C42D9EC00023C7B /* ReplyDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95310FAA2C42D9EC00023C7B /* ReplyDetailViewController.swift */; };
95310FAD2C42D9FB00023C7B /* ReplyDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95310FAC2C42D9FB00023C7B /* ReplyDetailView.swift */; };
95310FB02C42E0CB00023C7B /* ReplyDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95310FAF2C42E0CB00023C7B /* ReplyDetailModel.swift */; };
95310FB22C434E0B00023C7B /* ReplyWaitingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95310FB12C434E0B00023C7B /* ReplyWaitingView.swift */; };
95310FB42C434E1E00023C7B /* ReplyWaitingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95310FB32C434E1E00023C7B /* ReplyWaitingViewController.swift */; };
95310FB72C43B07100023C7B /* ReplyWaitingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95310FB62C43B07100023C7B /* ReplyWaitingViewModel.swift */; };
Expand Down Expand Up @@ -276,7 +275,6 @@
95310FA52C41D97E00023C7B /* SplashViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashViewController.swift; sourceTree = "<group>"; };
95310FAA2C42D9EC00023C7B /* ReplyDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReplyDetailViewController.swift; sourceTree = "<group>"; };
95310FAC2C42D9FB00023C7B /* ReplyDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReplyDetailView.swift; sourceTree = "<group>"; };
95310FAF2C42E0CB00023C7B /* ReplyDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReplyDetailModel.swift; sourceTree = "<group>"; };
95310FB12C434E0B00023C7B /* ReplyWaitingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReplyWaitingView.swift; sourceTree = "<group>"; };
95310FB32C434E1E00023C7B /* ReplyWaitingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReplyWaitingViewController.swift; sourceTree = "<group>"; };
95310FB62C43B07100023C7B /* ReplyWaitingViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReplyWaitingViewModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -857,7 +855,6 @@
isa = PBXGroup;
children = (
95310FB52C43B06600023C7B /* ViewModels */,
95310FAE2C42E0BD00023C7B /* Models */,
95310FA92C42D98900023C7B /* ViewControllers */,
95310FA82C42D98400023C7B /* Views */,
);
Expand All @@ -882,14 +879,6 @@
path = ViewControllers;
sourceTree = "<group>";
};
95310FAE2C42E0BD00023C7B /* Models */ = {
isa = PBXGroup;
children = (
95310FAF2C42E0CB00023C7B /* ReplyDetailModel.swift */,
);
path = Models;
sourceTree = "<group>";
};
95310FB52C43B06600023C7B /* ViewModels */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -1104,7 +1093,6 @@
0BE7E9F12C4636DE000C5358 /* CalendarMonthlyResponseDTO.swift in Sources */,
0BFCC5DA2C2E8F0200B5E0DB /* CalendarModel.swift in Sources */,
0B4A1BC62C45401500E31EC4 /* MoyaPlugin.swift in Sources */,
95310FB02C42E0CB00023C7B /* ReplyDetailModel.swift in Sources */,
95310FAD2C42D9FB00023C7B /* ReplyDetailView.swift in Sources */,
95310F922C40706600023C7B /* NicknameView.swift in Sources */,
2CE637912C3D56C300B6EC6D /* AccountViewModel.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ struct GetReplyResponseDTO: Codable {
let nickname: String
let month: Int
let date: Int
let isRead: Bool
}
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ private extension CalendarViewController {
guard let self = self else { return }
let date = viewModel.selectedDateRelay.value
if viewModel.dailyDiaryDataRelay.value.diaries.count != 0 {
var isNew = false
let dateIndex = Int(DateFormatter.string(from: viewModel.selectedDateRelay.value, format: "dd")) ?? 1
let diaries = viewModel.monthlyCalendarDataRelay.value.diaries

Expand All @@ -207,13 +206,7 @@ private extension CalendarViewController {
replyStatus = "특정 값"
}

if replyStatus == "READY_NOT_READ" {
isNew = true
} else {
isNew = false
}

self.navigationController?.pushViewController(ReplyWaitingViewController(date: date, isNew: isNew, isHomeBackButton: false), animated: true)
self.navigationController?.pushViewController(ReplyWaitingViewController(date: date, isHomeBackButton: false), animated: true)
} else {
self.navigationController?.pushViewController(WritingDiaryViewController(date: date), animated: true)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ private extension ListViewController {
guard let self = self else { return }
let dateData = DateFormatter.date(from: date)
let diaryStatus = viewModel.listDataRelay.value.diaries.first(where: { $0.date == date})?.replyStatus
let isNew = diaryStatus == "READY_NOT_READ"

self.navigationController?.pushViewController(ReplyWaitingViewController(date: dateData ?? Date(), isNew: isNew, isHomeBackButton: false), animated: true)
self.navigationController?.pushViewController(ReplyWaitingViewController(date: dateData ?? Date(), isHomeBackButton: false), animated: true)
})
.disposed(by: disposeBag)

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ final class ReplyDetailViewController: UIViewController {
private let year: Int
private let month: Int
private let day: Int
private let isNew: Bool

// MARK: - UI Components

Expand All @@ -36,11 +35,10 @@ final class ReplyDetailViewController: UIViewController {

// MARK: - Life Cycles

init(year: Int, month: Int, day: Int, isNew: Bool) {
init(year: Int, month: Int, day: Int) {
self.year = year
self.month = month
self.day = day
self.isNew = isNew
super.init(nibName: nil, bundle: nil)
}

Expand Down Expand Up @@ -142,8 +140,8 @@ private extension ReplyDetailViewController {
}
}

func judgeIsAlert(isNew: Bool) {
if isNew {
func judgeIsAlert(isRead: Bool) {
if !isRead {
showAlert()
}
}
Expand Down Expand Up @@ -178,7 +176,7 @@ private extension ReplyDetailViewController {
self.hideLoadingIndicator()
self.nickname = data.nickname
self.rootView.bindData(nickname: data.nickname, content: data.content)
self.judgeIsAlert(isNew: self.isNew)
self.judgeIsAlert(isRead: data.isRead)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ final class ReplyWaitingViewController: UIViewController {
private let disposeBag = DisposeBag()
private var totalSeconds = 60
private var date: Date
private var isNew: Bool
private let isHomeBackButton: Bool
private let secondsToWaitForFirstReply = 60
private let secondsToWaitForNormalReply = 12 * 60 * 60
Expand All @@ -32,9 +31,8 @@ final class ReplyWaitingViewController: UIViewController {

// MARK: - Life Cycles

init(date: Date, isNew: Bool, isHomeBackButton: Bool) {
init(date: Date, isHomeBackButton: Bool) {
self.date = date
self.isNew = isNew
self.isHomeBackButton = isHomeBackButton

super.init(nibName: nil, bundle: nil)
Expand Down Expand Up @@ -186,8 +184,7 @@ private extension ReplyWaitingViewController {
ReplyDetailViewController(
year: year,
month: month,
day: day,
isNew: self.isNew
day: day
),
animated: true
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ private extension WritingDiaryViewController {
if type == "DELETED" {
self.navigationController?.popViewController(animated: true)
} else {
self.navigationController?.pushViewController(ReplyWaitingViewController(date: self.date, isNew: true, isHomeBackButton: true), animated: true)
self.navigationController?.pushViewController(ReplyWaitingViewController(date: self.date, isHomeBackButton: true), animated: true)
}
case .network:
self.showErrorAlert(isNetworkError: true)
Expand Down

0 comments on commit b0075d8

Please sign in to comment.