-
Notifications
You must be signed in to change notification settings - Fork 0
컴바인 스터디 과제(HongJunBeom) #10
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
base: main
Are you sure you want to change the base?
Conversation
y-eonee
left a comment
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.
좋습니다~~
| struct DailyBoxOffice: Decodable { | ||
| let rnum: String // 순번 | ||
| let rank: String // 순위 |
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.
꿀팁: cmd + a -> cmd + i 하면 줄바꿈됩니다
| output.boxOfficeList | ||
| .sink { [weak self] list in | ||
| self?.boxOfficeList = list | ||
| self?.contentView.movieTableView.reloadData() | ||
| } | ||
| .store(in: &cancellables) | ||
|
|
||
| output.isLoading | ||
| .sink { [weak self] isLoading in | ||
| self?.contentView.setLoading(isLoading) | ||
| } | ||
| .store(in: &cancellables) | ||
|
|
||
| contentView.onTapInquiry = { [weak self] date in | ||
| self?.inquiryButtonTappedSubject.send(date) |
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.
굿
🍎 iOS Pull request
🏓 구현 내용
datePicker
일별 박스오피스 API를 활용했기 때문에 DatePicker를 활용하여 날짜를 선택하고, 해당 날짜에 맞는 박스오피스 데이터를 조회할 수 있게 했습니다.
Input/Output 패턴
Input
inquiryButtonTapped: 조회 버튼 탭 이벤트와 선택된 Date 전달Output
boxOfficeList: API 응답으로 받은 박스오피스 영화 목록isLoading: API 호출 중 로딩 상태Input/Output 패턴을 사용하여 View에서 발생한 이벤트와 ViewModel에서 관리하는 상태를 명확히 분리했습니다.
transform함수map: API 요청 형식에 맞게 문자열을 변환flatMap: 비동기 API 호출처리sink: 결과 받아서 로딩 종료 및 데이터 전달처음에는
sink안에서 또sink를 사용하니 중첩 구조가 복잡했는데,flatMap을 활용하여 비동기 데이터 흐름을 깔끔하게 처리했습니다.📸 스크린샷
☠️ 어려웠던 점
벌써 스터디 막바지네요 ㄷㄷ
모두 고생 많으셨습니다~~