From 3ace78e195931974c2984b062d1107eed632e347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=98=81=EC=9E=AC?= Date: Thu, 8 Apr 2021 11:42:17 +0900 Subject: [PATCH 1/2] baekjoon 1 --- .../Source/Cell/ScoreRecordCell.swift | 9 +++---- .../Source/ViewController/MyPageVC.swift | 27 ++++++++++--------- .../ViewController/RecordTabChildVC1.swift | 13 ++++----- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/Runners_Hi/Runners_Hi/Source/Cell/ScoreRecordCell.swift b/Runners_Hi/Runners_Hi/Source/Cell/ScoreRecordCell.swift index f5fbb82..8dba97c 100644 --- a/Runners_Hi/Runners_Hi/Source/Cell/ScoreRecordCell.swift +++ b/Runners_Hi/Runners_Hi/Source/Cell/ScoreRecordCell.swift @@ -26,13 +26,12 @@ class ScoreRecordCell: UICollectionViewCell { scoreDateLabel.font = UIFont(name:"NanumSquareR", size:12.0) scoreDateLabel.textColor = .brownishGrey getKmLabel.font = UIFont(name:"AvenirNext-BoldItalic", size:28.0) - KmNameLabel.font = UIFont(name:"NanumSquareR", size:14.0) getTimeLabel.font = UIFont(name:"AvenirNext-BoldItalic", size:28.0) - TimeNameLabel.font = UIFont(name:"NanumSquareR", size:12.0) - - self.KmNameLabel.text = "킬로미터" - self.TimeNameLabel.text = "러닝시간" + KmNameLabel.setLabel(text: "킬로미터", color: .black, font: .nanumBold(size: 14.0)) + TimeNameLabel.setLabel(text: "러닝시간", color: .black, font: .nanumBold(size: 12.0)) + + } } diff --git a/Runners_Hi/Runners_Hi/Source/ViewController/MyPageVC.swift b/Runners_Hi/Runners_Hi/Source/ViewController/MyPageVC.swift index 45cf8db..208ebc2 100644 --- a/Runners_Hi/Runners_Hi/Source/ViewController/MyPageVC.swift +++ b/Runners_Hi/Runners_Hi/Source/ViewController/MyPageVC.swift @@ -8,7 +8,7 @@ import UIKit -class MyPageVC: UIViewController { +class MyPageVC: UIViewController, UICollectionViewDelegate { static let identifier: String = "MyPageVC" // Mark: Variable Part @@ -37,7 +37,7 @@ extension MyPageVC: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { guard let ProfileBadgeCell = collectionView.dequeueReusableCell(withReuseIdentifier: ProfileBadgeCell.identifier, for: indexPath) as? ProfileBadgeCell else { return UICollectionViewCell()} - + // 해당 셀에 데이터를 전달하고, 데이터에 맞게 뱃지를 세팅하도록 하는 함수를 호출한다 ProfileBadgeCell.setMyProfileBadgeData(data: MyProfileModel, index: indexPath.row) @@ -53,19 +53,19 @@ extension MyPageVC: UICollectionViewDataSource { MyProfileHeader.myPageHeaderData(data: MyProfileModel) return MyProfileHeader - default: assert(false, "오류") } + default: assert(false, "오류") + + } + + + + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize { + let width: CGFloat = collectionView.frame.width + let height: CGFloat = 359 + return CGSize(width: width, height: height) } } - - - - func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> CGSize { - let width: CGFloat = collectionView.frame.width - let height: CGFloat = 359 - return CGSize(width: width, height: height) } - } - extension MyPageVC: UICollectionViewDelegateFlowLayout{ func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: @@ -112,7 +112,7 @@ extension MyPageVC { self.myPageCollectionView.reloadData() self.myPageCollectionView.dataSource = self self.myPageCollectionView.delegate = self - + case .requestErr: print(".requestErr") @@ -127,3 +127,4 @@ extension MyPageVC { } } } + diff --git a/Runners_Hi/Runners_Hi/Source/ViewController/RecordTabChildVC1.swift b/Runners_Hi/Runners_Hi/Source/ViewController/RecordTabChildVC1.swift index aa604db..12b4576 100644 --- a/Runners_Hi/Runners_Hi/Source/ViewController/RecordTabChildVC1.swift +++ b/Runners_Hi/Runners_Hi/Source/ViewController/RecordTabChildVC1.swift @@ -14,14 +14,13 @@ class RecordTabChildVC1: UIViewController { @IBOutlet weak var scoreRecordCollectionView: UICollectionView! override func viewDidLoad() { - + super.viewDidLoad() self.view.backgroundColor = .backgroundgray self.scoreRecordCollectionView.backgroundColor = .backgroundgray + getRecord() scoreRecordCollectionView.dataSource = self scoreRecordCollectionView.delegate = self - super.viewDidLoad() - getRecord() - self.scoreRecordCollectionView.reloadData() + // self.scoreRecordCollectionView.reloadData() } } @@ -29,8 +28,8 @@ class RecordTabChildVC1: UIViewController { extension RecordTabChildVC1: UICollectionViewDataSource { func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { -// return 20 - return RecordModel?.data.count ?? 0 + return 20 + //return RecordModel?.data.count ?? 0 } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { @@ -116,12 +115,10 @@ extension RecordTabChildVC1 { data in guard let `self` = self else {return} switch data { - case .success(let res): let response = res as? RecordAllData self.RecordModel = response self.scoreRecordCollectionView.reloadData() - case .requestErr: print(".requestErr") case .pathErr: From 0f2f3659f60ef2a1242a04bf11ae60cd1eb44366 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=98=81=EC=9E=AC?= Date: Thu, 8 Apr 2021 11:44:51 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[refactor]=20Record=20Tab=20body=20:=20Reco?= =?UTF-8?q?rdTab=20=EC=85=80=20=ED=91=9C=EC=8B=9C=20=EC=95=88=EB=90=98?= =?UTF-8?q?=EB=8D=98=20=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0=20=20=20=20?= =?UTF-8?q?=20=20=20=20ScoreRecordCell=20=EB=B6=80=EB=B6=84=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC=EC=A4=91=20Related=20to=20:=20#47?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Runners_Hi/Runners_Hi/Source/Cell/ScoreRecordCell.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Runners_Hi/Runners_Hi/Source/Cell/ScoreRecordCell.swift b/Runners_Hi/Runners_Hi/Source/Cell/ScoreRecordCell.swift index 8dba97c..0c64fad 100644 --- a/Runners_Hi/Runners_Hi/Source/Cell/ScoreRecordCell.swift +++ b/Runners_Hi/Runners_Hi/Source/Cell/ScoreRecordCell.swift @@ -27,7 +27,8 @@ class ScoreRecordCell: UICollectionViewCell { scoreDateLabel.textColor = .brownishGrey getKmLabel.font = UIFont(name:"AvenirNext-BoldItalic", size:28.0) getTimeLabel.font = UIFont(name:"AvenirNext-BoldItalic", size:28.0) - + + // font 익스텐션 적용 KmNameLabel.setLabel(text: "킬로미터", color: .black, font: .nanumBold(size: 14.0)) TimeNameLabel.setLabel(text: "러닝시간", color: .black, font: .nanumBold(size: 12.0))