-
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
[Feat/NST-13] 그룹상세화면 구현 #33
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.
캬 좋네요 야무지십니다 👍👍
멘트 몇 개 남겨놓았으니 확인해주시고, 트슈 기다릴게요~ ^^7
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.
vector는 너무 포괄적인 이름 같아요! ic_arrow_right 같은 네이밍도 괜찮지 않을까요?
///타임테이블 뷰 : "요일 월/일" | ||
static func dateList(_ dateStrings: [String]) -> [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.
NSTDateUtility는 모든 개발자들이 사용하는 유틸리티일거에요.
본 유틸리티에서 static func으로 추가하여 사용한다면, 불특정 다수의 개발자가 해당 함수를 사용할 수 있겠죠?
- 다른 영역에서도 넓게 쓰일 수 있도록 함수 이름과 사용 예시를 명확히 정해주세요
or - 사용하는 뷰 내부에서 private하게 자체적으로 만들어 써도 될 것 같아요
둘 중 하나로 골라서 진행해보시면 좋을 것 같아요!
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.
오우 이거 수정한다는걸 깜먹고 올렸네요 수정하고 올리겠슴당
// 날짜 포맷: "9월 7일 (일)" | ||
dateFormatter.dateFormat = "M월 d일 (E)" | ||
|
||
// 시간 포맷: "10:00" | ||
let timeFormatter = DateFormatter() | ||
timeFormatter.locale = Locale(identifier: "ko_KR") | ||
timeFormatter.timeZone = TimeZone(identifier: "Asia/Seoul") | ||
timeFormatter.dateFormat = "HH:mm" |
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.
해당 코드를 막기 위해 본 NSTDateUtility 코드가 존재한답니다!
해당 코드 문서와 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.
CollectionViewCell은 작성하실 때 prepareForReuse가 필요한 부분은 없는지 한 번씩 확인해보세요!
해당 코드에서 disposeBag은 사용되지 않아 지워도 되겠지만, 만약 실제 Rx subscribe나 bind가 되어 있는경우 PrepareForReuse에서 disposeBag을 초기화해주세요.
func bind(reactor: ConfirmedCellReactor) { | ||
let schedule = reactor.currentState.schedule | ||
chip.backgroundColor = schedule.schedule.category.displayColor | ||
scheduleTitleLabel.text = schedule.schedule.name | ||
timeLabel.text = NSTDateUtility.durationList(schedule.startTime, schedule.endTime) | ||
} |
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.
rx 바인드하는 내용은 없으니 이름을 바꿔도 괜찮지 않을까요?!
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.reactor=reactor 로 할당하기 위해 bind 메소드를 썼습미다
let inProgressLayout = UICollectionViewFlowLayout() | ||
let confirmedLayout = UICollectionViewFlowLayout() | ||
self.inProgressCollectionView = UICollectionView(frame: .zero, collectionViewLayout: inProgressLayout) | ||
self.confirmedCollectionView = UICollectionView(frame: .zero, collectionViewLayout: confirmedLayout) |
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.
트러블 슈팅 기다리고 있겠습니다 ^^7
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.
2차스프린트 전에는..
// MARK: setUpUI | ||
private func setUpUI() { | ||
profileImageView.do { | ||
$0.layer.cornerRadius = 7.14 |
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 index == 0 { | ||
return Observable.concat([ | ||
.just(.selectSegment(index)), | ||
.just(.loadInProgressData) | ||
]) | ||
} else { | ||
return Observable.concat([ | ||
.just(.selectSegment(index)), | ||
.just(.loadConfirmedData) | ||
]) | ||
} |
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.
해당 부분은 삼항연산자로 묶어주면 3줄로 축약해서 가독성을 높일 수 있을 것 같네요!
// MARK: - Bind Reactor | ||
func bind(reactor: GroupDetailReactor) { | ||
rootView.segmentedControl.rx.selectedSegmentIndex | ||
.distinctUntilChanged() |
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.
굳 👍
// 날짜 포맷: "9월 7일 (일)" | ||
dateFormatter.dateFormat = "M월 d일 (E)" |
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.
NSTDateUtility에 이 포맷 case로 추가 하면 돼요!
let inProgressLayout = UICollectionViewFlowLayout() | ||
let confirmedLayout = UICollectionViewFlowLayout() | ||
self.inProgressCollectionView = UICollectionView(frame: .zero, collectionViewLayout: inProgressLayout) | ||
self.confirmedCollectionView = UICollectionView(frame: .zero, collectionViewLayout: confirmedLayout) |
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.
이것도 함수로 묶어서 정리하면 좋을 거 같아요
import RxSwift | ||
import UIKit | ||
|
||
final class GroupDetailReactor: Reactor { |
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.
Reactor 는 Reactor 폴더로 따로 빼면 좋을 것 같습니다~
} | ||
} | ||
|
||
extension GroupDetailViewController: UICollectionViewDelegateFlowLayout { |
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.
마크 주석을 잘 사용하시는거 같습니다. 여기도 부탁 드려요!
.bind(to: rootView.inProgressCollectionView.rx.items(cellIdentifier: InProgressCVC.identifier, cellType: InProgressCVC.self)) { index, reactor, cell in | ||
cell.reactor = reactor | ||
} | ||
.disposed(by: disposeBag) | ||
|
||
// 확정된 약속 바인딩 | ||
reactor.state.map { $0.confirmedCellReactors } | ||
.do(onNext: { _ in self.rootView.confirmedCollectionView.reloadData() }) | ||
.bind(to: rootView.confirmedCollectionView.rx.items(cellIdentifier: ConfirmedCVC.identifier, cellType: ConfirmedCVC.self)) { index, reactor, cell 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.
index 사용 안 한다면 와일드카드 패턴을 사용하면 좋을 것 같습니다.
DispatchQueue.main.async { | ||
self.rootView.layoutIfNeeded() | ||
} |
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.
여긴 꼭 필요한 Task 인가요? 꼭 필요하다면 왜 꼭 필요한가요??
import Then | ||
import ReactorKit | ||
|
||
final class InProgressCVC: UICollectionViewCell, View { |
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.
reactor를 매개변수로 받아서만 사용하는 것 같아요! View 프로토콜을 confirm안하면 bind 함수가 작동이 안되나요??
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.
네 bind(reactor:)는 리액터 내장함수입니당
🔥 Issue
close #30
🔥 변경된 내용
🔥 PR Point
GroupDetailViewController
는GroupDetailReactor
,InProgressCVC
는InProgressReactor
,ConfirmedCVC
는ConfirmedReactor
에서 관리해줍니다. 따로 셀의 reactor를 만든 이유는 cell.reactor로 바로 바인딩하기 위해서입니당.GroupDetailReactor
로직 중심으로 확인해주시면 감사하겠습니당Floating Btn과 Navigationbar, Tabbar는 추후 추가될 예정이예용