-
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
[ADD] 홈뷰, 하단 테이블 뷰 개발 #88
Conversation
if isSelected { | ||
self.titleImage.image = ImageLiterals.profilelightblue1Selected | ||
}else { | ||
self.titleImage.image = ImageLiterals.profileLightBlue1 |
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.
p1;
이미지 종류가 16개라서 isSelected 된 이미지 16개를 더 넣는 것보다,
isSelected 인 경우 radius 가 24인 파란색 원의 hidden 처리를 없애주는 게 더 좋지 않을까 싶어요!
OnboardingProfileGroupCollectionViewCell
파일 참고하시면 imageView 위에 checkCircleView
를 올려 선택 여부에 따라 원을 올리는/제거하는 로직을 구현해주면 될 것 같아요!
} | ||
} | ||
} | ||
|
||
// MARK: - property | ||
|
||
let titleImage: UIImageView = { |
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.
p1;
이건 let titleImage = UIImageView()
로 간단하게 표현할 수 있을 것 같아요!
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.
// MARK: - property | ||
|
||
let titleImage: UIImageView = { | ||
let imageView = UIImageView() | ||
imageView.image = ImageLiterals.profileLightBlue1 | ||
return imageView | ||
}() | ||
let titleLabel: UILabel = { |
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.
p1;
여기 폰트 등록된 이후로 수정 필요해서 caption1
으로 수정 부탁드립니다!
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.
@@ -42,4 +51,12 @@ final class HomeGroupCollectionViewCell: BaseCollectionViewCell { | |||
$0.leading.trailing.equalToSuperview() |
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.
p1;
위에 top 부분 수정이 필요해요!
offset을 4로 수정 부탁드립니다!!!
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 cell.isSelected == true { cell.onSelected() } | ||
else { cell.onDeselected() } |
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.
여기서 cell.titleLabel 지정해준 것처럼 cell.titleImage이 나중에 지정되면 이 로직은 필요없을 것 같아요!
지금은 titleImage가 property 생성할 때 지정되지 않아서 위 로직이 없으면 첫 cell을 제외하고 다른 이미지들을 보이지 않는데
나중에는 titleLabel과 동일하게 titleImage도 userList에서 불러올 거라서 이미지가 처음에 보이지 않는 문제가 없을 겁니다!
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.
어... 근데 그럼 아래 willDisplay 함수로 처음 셀 포커스와 이후 스크롤로 가려졌다가 보였을 때 포커스되는 셀을 지정하는 로직인데, 위에 유나님이 말씀하신 코드 없이는 마지막 인덱스 포커스했을 때 가려졌다가 보여지면 포커스가 해제되는 버그가 있어 넣어두었습니다!
func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) {
let selectedIndexPath = IndexPath(row: self.selectedIndex, section: 0)
collectionView.selectItem(at: selectedIndexPath, animated: false, scrollPosition: .init())
}
$0.top.equalToSuperview().offset(SizeLiteral.componentPadding) | ||
$0.leading.equalToSuperview().offset(SizeLiteral.componentPadding) | ||
} | ||
|
||
workerStackView.snp.makeConstraints { |
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.
p3;
지금은 worker를 세명만 넣어서 stackView에 넣어주셨는데
api 연결할 때는 table이나 collection 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.
넵! 확인했습니다! 해당 부분 collection 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.
코드 리뷰에 따른 반영해서 올려두었습니다! |
let titleImage = UIImageView() | ||
let checkCircleView: UIView = { | ||
let view = UIView() | ||
view.layer.borderWidth = 1.5 |
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.
p1;
view.layer.borderWidth = 1
피그마 상으로는 1인 것 같아요!!
} | ||
checkCircleView.snp.makeConstraints { | ||
$0.top.equalToSuperview() | ||
$0.centerX.equalToSuperview() |
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.
func collectionView(_ collectionView: UICollectionView, willDisplay cell: UICollectionViewCell, forItemAt indexPath: IndexPath) { | ||
let selectedIndexPath = IndexPath(row: self.selectedIndex, section: 0) | ||
collectionView.selectItem(at: selectedIndexPath, animated: false, scrollPosition: .init()) | ||
} |
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.
p2;
앗 이렇게 하기보다는
cellForItemAt
부분에
if selectedIndex == indexPath.item {
cell.isSelected = true
collectionView.selectItem(at: indexPath, animated: false, scrollPosition: .init())
}
여기에 이렇게 추가해주시면 될 것 같아요!
Cell에서 circleView 선언할 때 isHidden = true
로 해주시구요!
checkCircleView.isHidden = false | ||
self.bringSubviewToFront(titleImage) |
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.
p2;
요기는 밑에서 만들어 두신
onSelected
와 onDeselected
사용해주시면 될 것 같습니다!
📣 Related Issue
👩💻 Contents & Screenshot
📌 Review Point
🧐 Question