-
Notifications
You must be signed in to change notification settings - Fork 82
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
[Team-08][iOS] Calendar Model 생성 / CollectionView HeaderCell 추가 작업 #75
Conversation
[Feat] calendar modeling
[#6] feat: 숙소 찾기 VC 에 CollectionView, HeaderView, Cell 요소 작업
안녕하세요 롤로! 저희가 PR 을 보내면서 최종 확인하는 과정에서 추가로 수정할 거리들이 남아있어서 추가로 커밋을 하였습니다. 이번 PR 관련 커밋은 더 이상 없을 예정이오니 참고바랍니다! 리뷰 부탁드리겠습니다~~~ |
chore: 사용하지 않는 주석 제거
넵 금요일 PR은 이것으로 더 이상 추가 커밋은 없습니다. ~~ 감사합니다 ~ |
이번 작업도 고생 많으셨습니다 :) |
var fadeLeft: Bool = false | ||
// 선택되었을 시 오른쪽부터 서서히 채워나가는 이펙트를 줌 | ||
var fadeRight: Bool = 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.
fadeLeft와 fadeRight가 동시에 true일 경우도 있는 걸까요?👀
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.
말씀 듣고 보니 디자인에는 둘 다 true 일 수 없군요!
fade 라는 것 자체를 enum 타입으로 변경하는 것이 의미 상 맞는 것 같습니다!!
|
||
lazy var removeButton: UIBarButtonItem = { | ||
lazy var removeSearchTextField: UIBarButtonItem = { |
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.
이 버튼은 네이밍이 메소드스럽네요ㅎㅎ
그리고 내용을 비우는 거라면 clearSearchField 메소드와 대응되도록 remove보다는 clear가 적절해보입니다 :)
!searchText.isEmpty | ||
? (navigationItem.rightBarButtonItem = removeButton) | ||
? (navigationItem.rightBarButtonItem = removeSearchTextField) | ||
: (navigationItem.rightBarButtonItem = nil) |
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.
참고로 이 부분은 아래와 같이 쓸 수도 있습니다 :)
navigationItem.rightBarButtonItem = !searchText.isEmpty ? removeSearchTextField : nil
cell.cityName.text = locations[indexPath.row] | ||
cell.spendingTime.text = locations[indexPath.row] |
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.
locations.count가 곧 셀 개수가 되긴 하지만, index를 통해 정보를 빼 내올 때엔 늘 안전장치를 마련해두는 것이 좋습니다!
존재하지 않는 인덱스를 참조하게 되면 바로 크래시가 나게 되니까요.
그리고 여기서 쓰이는 location들은 추후 다른 정보들을 포함하게 될 가능성도 있어 보이네요. 별개의 타입으로 만들기에 적절해보입니다 :)
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.
그리고 locations를 뷰 컨트롤러에서 가지고 있을 때의 장단점에 대해서도 생각해보면 좋겠네요ㅎㅎ
func test_generateDays_performance() throws { | ||
self.measure { | ||
for _ in 1...10000 { | ||
model.getNextMonthDays(from: 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.
기대한만큼의 성능이 나왔나요?
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.
처리되는 속도가 Big-O 표기법으로 표현하자면 O(n) 으로 늘어나는 것을 기대하였고 개인적으로는 그렇게 나왔다고 생각하였습니다.
개인적인 생각보단 구체적인 데이터를 제시해드리고 싶은데 아직 테스트 성능과 관련된 부분에 공부가 부족합니다. 다음 테스트에서는 성능과 관련된 구체적 자료를 제시할 방안이 있는지 찾아보도록 하겠습니다!
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.
넵넵ㅎㅎ 이렇게 테스트해보신 것 자체가 대단하네요!! 고생 많으셨습니다!
…fo_search feat: [40] 숙소 예약 내역 상세 조회
2022/05/27 Pull Request
🔨 관련 Issue
👨🏻💻 작업 내용
💭 고민한 점과 해결
==> SearchVC 에서 LcationVC 를 띄우는 작업에서 show() 메서드를 사용하고 있었습니다. 그래서 Search Controller 가 작동하지 않는 문제가 있었는데, CollectionView 나 SearchBar의 어떤 설정을 빠뜨린줄 알고 디버깅을 하느라 시간을 많이 허비했었습니다. 그러던 중 그만하고 자야겠다라고 생각이 들었을 때, 다른 분들께 도움 요청을 해서 알아낸 사실이 show() 대신 pushViewController() 를 사용하면 네비게이션 바에 SearchBar가 포함이 된다고 알려주셔서 허무했습니다. 사실 긍정적으로 보면 많은 시간을 써서 문제점을 발견한 것인데, 막상 코드 한줄로 해결이 되니까 허탈한 기분이 들었습니다.
==> CollectionView 의 Layout을 그리는 부분은 크게 4부분이 존재합니다.
처음에 작업할 때, 4번의 CustomCell 의 Layout을 잡는 부분에서만 Layout을 짜고선 Layout이 생각대로 되지 않아서 좀 당황했었는데, LocationVC에서 1,2,3번에서 적용한 Constraints 나 Size 정의 때문에 그렇게 되는 것을 알고, 각 요인을 독립 시행을 하면서 어떤식으로 작동하는지 공부했습니다. 그런데 도통 감이 오지 않아 동기 멤버들에게 페어 프로그래밍을 요청해서 해결했습니다. 지금 코드에서는 header 뷰와 Cell 이 공통된 Constraint를 받아야해서, Cell 의 사이즈를 3번 메서드를 통해 정의했고, 전체 CollectionView의 Constraints를 줌으로써 header와 Cell 의 통일성을 가져갔습니다. 4번인 CustomCell 에서 cell 의 구성요소를 제어하는 코드를 만들었습니다.
📱 데모
[iOS 결과 시뮬레이션]
[캘린더 모델 기능 테스트 결과]