-
Notifications
You must be signed in to change notification settings - Fork 5
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
기록 수정 기능 구현 #36
기록 수정 기능 구현 #36
Conversation
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.
디자인과 요구사항만으로 개발하시는게 어려우셨을텐데 고생많으셨습니다!
원하는 느낌대로 잘 구현해주셔서 감사합니다 :)
코드리뷰를 하기 전에 앞서 직접 돌려보면서 발견한 기능 관련 리뷰를 먼저 남길께요🙌
PR 반영할 수정 및 개선사항들
내역은 현재 PR 에 다음주까지 반영해주시면 rebase 하겠습니다.
로직 수정 필요내용
, 필요한 추가기능들
및 코드리뷰 내역은 해당 PR 이 아닌 추가 PR에서 반영하는 식으로 진행할께요
이부분의 경우 수정님 개발범위를 벗어나겠다 싶은 경우 제가 이어서 작업합니다.
|
|
|
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.
수고하셨습니다!~~!!!!!!~😵
|
||
@IBAction func modifyRecord(_ sender: Any) { | ||
guard let viewModel = viewModel, | ||
let targetDaily = viewModel.currentDaily else { return } |
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.
기록이 존재하지 않는 경우 popup 알림 또는 Create 로 수정된 로직 추가 필요
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.
Alert 팝업으로 구현 완료했습니다.
var date: Date = Date() | ||
var changeHandler: DateChangeHandler? |
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.
public func configure(date: Date, handler: DateChangeHandler)
식의 함수로 묶는것도 좋을 것 같아요
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.
반영 완료했습니다!
class EditHistoryVC: UIViewController { | ||
@IBOutlet weak var startTimeButton: UIButton! | ||
@IBOutlet weak var endTimeButton: UIButton! | ||
@IBOutlet weak var intervalLabel: UILabel! | ||
|
||
@Published var history: TaskHistory = TaskHistory(startDate: Date(), endDate: Date()) | ||
private var cancellables = Set<AnyCancellable>() |
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.
외부에서 해당 VC 의 color index 값을 넣어줘야 할 것 같아요 해당 property 가 필요할 것 같아요
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.
반영했습니다:) 각 과목 컬러 반영 기능 구현 완료했습니다.
self?.timelineVM.update(daily: daily) | ||
self?.tasks = daily.tasks.sorted(by: { $0.value > $1.value }) | ||
.map { TaskInfo(taskName: $0.key, taskTime: $0.value) } |
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.
timelineVM 의 updateColor 관련 로직이 필요
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.
반영 완료!
// TODO: 새벽 12시-4시는 다음 날짜로 처리 | ||
// TODO: 시작시각 > 종료시각인 경우 예외처리 | ||
self.selectedTaskHistorys?.append(history) | ||
self.selectedTaskHistorys?.sort(by: { $0.startDate < $1.startDate }) |
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.
AM 05:00:00 ~ AM 04:59:59 순으로 sort 로직으로 수정 필요
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.
수정 완료했습니다.
} | ||
|
||
extension HistoryCell { | ||
func configure(with taskHistory: TaskHistory?) { |
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.
index 값을 받아와 color 를 계산하는 로직이 필요
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.
반영 완료!
private func emptyInteractionFrameView() { | ||
self.taskInteractionFrameView.subviews.forEach { $0.isHidden = true } | ||
} | ||
|
||
private func showTaskInteractionViewPlaceholder() { | ||
self.emptyInteractionFrameView() | ||
self.taskInteratcionViewPlaceholder.isHidden = false | ||
} |
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.
추후 hidden -> alpha 로직으로 수정 필요
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.
수정했습니다!
if taskInfo.taskName == self.viewModel?.selectedTask { | ||
cell.layer.borderWidth = 2 | ||
cell.layer.borderColor = UIColor.red.cgColor | ||
} else { | ||
cell.layer.borderWidth = 0 | ||
} |
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.
StandardDailyTaskCell 내 function 으로 수정
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.
수정 완료했습니다.
graph == .standardDailyGraphView, | ||
let taskName = self.viewModel?.tasks[indexPath.row].taskName else { return } | ||
// 그래프에서 Task 선택 -> 기존 Task 편집 모드로 전환 | ||
self.viewModel?.changeToExistingTaskMode(task: taskName) |
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.
viewModel.changeToExistingTaskMode 내에서 과거형식 로직 확인 필요
extension ModifyRecordVC { | ||
@objc func saveButtonTapped() { | ||
self.viewModel?.save() | ||
self.showOKAlert(title: "저장 완료", message: "변경 사항이 저장되었습니다") { [weak self] in |
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.
localized 가 필요
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.
localized 전부 반영했습니다:)
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.
수정사항이 많았는데 많이 도와주셔서 감사합니다ㅠㅠ
그간 정말 힘이되었어요 고생정말 많으셨습니다!!
개발하신것들이 취업때 도움이 되었으면 좋겠네요ㅎㅎ
🫵👍😎
self.selectedTaskHistorys?.sort(by: { | ||
var lhsHour = $0.startDate.hour | ||
var rhsHour = $1.startDate.hour | ||
|
||
if lhsHour < 5 { lhsHour += 24 } | ||
if rhsHour < 5 { rhsHour += 24 } | ||
|
||
if lhsHour != rhsHour { | ||
return lhsHour < rhsHour | ||
} else { | ||
return $0.startDate < $1.startDate | ||
} | ||
}) |
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.
💯 👍
작업 내용
동작 화면
고민과 해결 및 리뷰 포인트
mode
라는 프로퍼티에 저장하여 관리하였다.TaskModifyInteractionView
TaskCreateInteractionView
ADD
버튼을 터치해야 그래프에도 반영된다.currentDaily
를 업데이트하여 그래프가 업데이트 되도록 하였다.viewDidLoad()
시점에 모두addSubview()
하고,isHidden
프로퍼티로 보이기/가리기 처리한다.EditHistoryView
에서 시작/종료 시각 버튼을 터치하면 popover 방식으로 DatePicker가 나타난다.EditHistroyVC
로 가저오는 방식에 대해 고민하였다.(=EditDateVC
에서EditHistoryVC
로)DatePicker의 date값이 변경되었을 때
뿐이므로 단순 클로저 전달로 구현하였다.TaskInteractionView
를 정의한 뒤 상속하였다.레퍼런스
없음