-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Refactor] #198 - 홈 UI 로직 변경 #204
Conversation
case .success(let response): | ||
do { | ||
self.missionDailyData = try response.map(GeneralArrayResponse<DailyMissionResponseDTO>?.self) | ||
guard let missionDailtData = self.missionDailyData 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.
이 함수에서 completion이 escaping 클로저여서 이 함수가 끝났다는 것을 알려주는 역할을 하는데
요렇게 return 부분에 completion handler가 없으면 끝났다는걸 알릴 방법이 없어진다고 하네여!!
그래서 요 부분에도 밑에 .failure 에 completion(nil) 추가해준 것처럼 completion을 추가해주면 좋을 것 같습니다~
관련내용은 Meet async/await in Swift라는 WWDC 세션에 앞부분에 나와여! (결국 여기서 하는 말은 이거 다 개발자 책임이니까 이제 async, await를 쓰라고 하긴 함 ㅋㅋ ㅠㅠ)
밑에 제가 세션들으면서 필기한 내용 간단히 캡쳐한거 올려보겟슴다..
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.
오오 !! 감사합니다:)
return 부분에 completion은 생각을 못하고 있었던 부분인 것 같아요! ㅠㅠ
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.
HomeAPI.shared.getDailyMission(date: date) { response in | ||
guard let response = response else { return } | ||
guard let data = response.data else { return } | ||
let missionList = data | ||
self.updateData(item: missionList) | ||
} |
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.
escaping closure라서 weak self를 써줘야 안전하게 메모리 해제될 것 같네여~
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.
앗 ! 이 부분도 수정하겠습니당!
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 let horizonStackView = UIStackView() | ||
private let leftButton = UIButton() | ||
private let rightButton = UIButton() | ||
var calendar = WeekMonthFSCalendar() |
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.
사소하지만 들여쓰기,,ㅎㅎ
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.
어멋 ..ㅎㅎ
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.
snapshot.appendItems([.empty], toSection: .empty) | ||
} | ||
|
||
func updateSnapShot(missioList: [DailyMissionResponseDTO]) { |
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.
missio 오타같아용 ㅎ.ㅎ
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 Point
private var currentSection: [Sections] = [.empty]
변수를 선언하여 데이터가 업데이트 될 때마다 현재의 section을 지우고 새로운 section을 append하도록 수정했습니다.📸 스크린샷
Simulator.Screen.Recording.-.iPhone.SE.3rd.generation.-.2023-11-24.at.01.10.19.mp4
📮 관련 이슈