-
Notifications
You must be signed in to change notification settings - Fork 2
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 [#44] homeViewUI 구현과 분기처리 #59
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.
P3. 분기처리 진짜찐짜 고생하셨습니다. 오늘도 어쨋든 성공보연
static var blackHoleThridStep = "블랙홀이 가까워졌어요\n스마트폰을 멀리해 볼까요?" | ||
static var blackHoleFourthStep = "블랙홀에 빠질 수 있어요\n스마트폰을 내려놓아요" | ||
static var blackHoleFifthStep = "지금부터 앱을 사용하면\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.
P3. 여기는 빈 줄이 없는 게 더 좋을 것 같아요!
$0.font = .iosText6Medium14 | ||
$0.textColor = .gray2 | ||
$0.textAlignment = .center | ||
$0.text = "남음" |
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. 여기 StringLiteral로 관리해줍시다!
appIconImageView.snp.makeConstraints { | ||
$0.size.equalTo(40) | ||
} |
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. 저희 앱 아이콘 뷰에서 사라져서 없애야 합니다!
private func setConstraints() { | ||
appProgressBar.snp.makeConstraints { | ||
$0.height.equalTo(75.adjusted) | ||
$0.horizontalEdges.equalToSuperview().inset(20) |
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. adjusted
를 했을 때 뷰가 깨지지 않는다면, 여기 .adjusted
추가해주세요!
blackholeImageCell.configureCell(image: ImageLiterals.TabBar.icMyPage, text: StringLiteral.Home.blackHoleFirstStep) | ||
} else if progressPrecent < 0.49 { | ||
blackholeImageCell.configureCell(image: ImageLiterals.TabBar.icChallengeSelected, text: StringLiteral.Home.blackHoleSecondStep) | ||
} else if progressPrecent < 0.74 { | ||
blackholeImageCell.configureCell(image: ImageLiterals.TabBar.icChallenge, text: StringLiteral.Home.blackHoleThridStep) | ||
} else if progressPrecent < 0.99 { | ||
blackholeImageCell.configureCell(image: ImageLiterals.TabBar.icHomeSelected, text: StringLiteral.Home.blackHoleFourthStep) | ||
} else { | ||
blackholeImageCell.configureCell(image: ImageLiterals.TabBar.icMyPageSelected, text: StringLiteral.Home.blackHoleFifthStep) |
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. 파라미터 기준으로 줄 바꿈하는 건 어떠신지 ?
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 configureCell (image: UIImage, text: String){ | ||
blackHoleImageView.image = image | ||
homeBlackHoleStateLabel.text = text | ||
homeBlackHoleStateLabel.setTextWithLineHeight(text: text, lineHeight: 33) |
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.
p4. adjusted 달아주는게 좋은데 어떻게 생각하세요?
return data.reduce(0) { $0 + Int($1.usedTime) } | ||
} | ||
|
||
func convertMillisecondsToHoursAndMinutes(milliseconds: Int) -> (hours: Int, minutes: Int) { |
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.
p4. 여러번 재활용될 수 있는데 글로벌하게 빼는 거 어떻게 생각하세요?
switch indexPath.section { | ||
case 0: | ||
return CGSize(width: collectionView.frame.width, height: collectionView.frame.width) | ||
case 1: |
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.
p4. 여기도 adjusted가 가능하지 않을까요?
👾 작업 내용
🚀 PR Point
전체 홈 뷰 구조
lottie 이미지와 텍스트를 첫 번째 section
, 전체 이용시간 프로그래스 바를 두 번째 section, 마지막 앱별 프로그래바를 cell로 만들어 데이터 개수에 따라 셀들이 쌓이는 세 번째 section으로 나눠서 그렸습니다.앱 사용 시간
[ 시간 단위 계산 함수 ]
[ 애니메이션 구현 ]
[ 전체 사용시간 ]
블랙홀 분기처리
homeView
의dataSource
에서 분기처리를 해줬습니다.[ 분기처리 과정 ]
📸 스크린샷
🚀 기기 대응
✅ Issue
Resolved #44