-
Notifications
You must be signed in to change notification settings - Fork 6
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] #155 - 습관방 만들기 화면전환 및 각종 코드 디테일 수정 #158
Changes from all commits
650e678
0154163
3e2d26f
6b7f81d
82a44a8
07316f9
9bba44a
2c79795
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,20 +24,33 @@ class MoreStorageCVC: UICollectionViewCell { | |
dDayLabel.text = "D-day" | ||
} | ||
|
||
override func prepareForReuse() { | ||
certificationImage.image = UIImage() | ||
dDayLabel.text = "" | ||
sparkCountLabel.text = "" | ||
} | ||
|
||
func initCell(leftDay: Int, | ||
mainImage: String, | ||
sparkCount: Int) { | ||
if mainImage == "" { | ||
certificationImage.image = UIImage(named: "stickerRestBigMybox") | ||
certificationImage.contentMode = .scaleAspectFit | ||
} else { | ||
sparkCount: Int, | ||
status: String) { | ||
switch status { | ||
case "NONE": | ||
certificationImage.image = UIImage() | ||
case "DONE": | ||
certificationImage.updateImage(mainImage) | ||
certificationImage.contentMode = .scaleAspectFill | ||
default: | ||
certificationImage.image = UIImage(named: "stickerRestBigMybox") | ||
} | ||
|
||
sparkCountLabel.text = String(sparkCount) | ||
|
||
if leftDay == 0 { | ||
dDayLabel.text = "D-day" | ||
} else if leftDay == 66 { | ||
dDayLabel.text = "D-\(leftDay)" | ||
certificationImage.image = UIImage() | ||
Comment on lines
+51
to
+53
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 66일은 모아보기 서버에서 안넘겨준다고 했지만 혹시 서버에서 잘못줄수도있으니 분기는 처리해둡시당 |
||
} else { | ||
dDayLabel.text = "D-\(leftDay)" | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// UIImage+.swift | ||
// Spark-iOS | ||
// | ||
// Created by Junho Lee on 2022/01/21. | ||
// | ||
|
||
import UIKit | ||
|
||
extension UIImage { | ||
func resize(newWidth: CGFloat) -> UIImage { | ||
let scale = newWidth / self.size.width | ||
let newHeight = self.size.height * scale | ||
let size = CGSize(width: newWidth, height: newHeight) | ||
let render = UIGraphicsImageRenderer(size: size) | ||
let renderImage = render.image { context in self.draw(in: CGRect(origin: .zero, size: size)) } | ||
return renderImage | ||
} | ||
Comment on lines
+11
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 호오... newWidth 는 어떤 기준이될까 궁금하네여 |
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -260,7 +260,7 @@ extension AuthUploadVC: UIImagePickerControllerDelegate, UINavigationControllerD | |
|
||
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [UIImagePickerController.InfoKey: Any]) { | ||
if let image = info[UIImagePickerController.InfoKey.originalImage] as? UIImage { | ||
uploadImageView.image = image | ||
uploadImageView.image = image.resize(newWidth: 250) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 어떤 기준이 됐을까여? |
||
fadeImageView.isHidden = false | ||
buttonStackView.isHidden = false | ||
photoAuthButton.isHidden = true | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -94,9 +94,6 @@ extension StorageMoreVC { | |
|
||
extension StorageMoreVC: UICollectionViewDelegateFlowLayout { | ||
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { | ||
// 컬렉션뷰 크기 정하기 | ||
// 컬렉션뷰 위드에 맞게 셀 위드 정하기 | ||
// 셀 위드에 대해서 간격과 높이 정하기 | ||
let cellWidth: CGFloat = collectionView.frame.width | ||
let cellWidthRatio: CGFloat = 160/375 | ||
let widthHeightRatio: CGFloat = 203/160 | ||
|
@@ -116,13 +113,20 @@ extension StorageMoreVC: UICollectionViewDelegateFlowLayout { | |
|
||
extension StorageMoreVC: UICollectionViewDataSource { | ||
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { | ||
return myRoomCertificationList?.count ?? 0 | ||
if myRoomCertificationList?.last?.leftDay == 66 { | ||
return ((myRoomCertificationList?.count ?? 0) - 1) | ||
} else { | ||
return myRoomCertificationList?.count ?? 0 | ||
} | ||
Comment on lines
+116
to
+120
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 이것도 66일 넘어올까봐에 대한 분기처리인가용? |
||
} | ||
|
||
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { | ||
guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Const.Xib.NibName.moreStorageCVC, for: indexPath) as? MoreStorageCVC else {return UICollectionViewCell()} | ||
|
||
cell.initCell(leftDay: myRoomCertificationList?[indexPath.row].leftDay ?? 0, mainImage: myRoomCertificationList?[indexPath.row].certifyingImg ?? "", sparkCount: myRoomCertificationList?[indexPath.row].sparkNum ?? 0) | ||
cell.initCell(leftDay: myRoomCertificationList?[indexPath.row].leftDay ?? 0, | ||
mainImage: myRoomCertificationList?[indexPath.row].certifyingImg ?? "", | ||
sparkCount: myRoomCertificationList?[indexPath.row].sparkNum ?? 0, | ||
status: myRoomCertificationList?[indexPath.row].status ?? "") | ||
|
||
return cell | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,8 +224,6 @@ extension HomeVC { | |
self.mainCollectionView.reloadData() | ||
} | ||
|
||
// FIXME: - 아래의 목적인데 한번 체크해야할듯 | ||
// 성공적으로 한번의 통신이 마무리된 후 무한스크롤 허용. 즉, 연속적으로 통신을 요청하지 않게 하기 위함. | ||
Comment on lines
-227
to
-228
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 요건 fixme 가 필요한 상태라 살려주실 수 있을까여 ㅜ |
||
completion() | ||
case .requestErr(let message): | ||
print("habitRoomFetchWithAPI - requestErr: \(message)") | ||
|
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.
oh.....wow..