From 09f657b7836d58496a7c0906f2e7e9d8c118da2e Mon Sep 17 00:00:00 2001 From: hyungyu Kim Date: Fri, 1 Oct 2021 17:30:29 +0900 Subject: [PATCH] =?UTF-8?q?[#45]=20initializer=20=EB=A9=94=EC=84=9C?= =?UTF-8?q?=EB=93=9C=20prefix=20'init'=20=EC=9C=BC=EB=A1=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD,=20cell=20=ED=81=B4=EB=9E=98=EC=8A=A4=EB=AA=85,=20cel?= =?UTF-8?q?l=20=EB=B3=80=EC=88=98=EB=AA=85=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Descriptions - code convention 에 맞춰 set prefix 메서드명들 init 으로 변경 - 변수명 소문자로 변경 - CollectionViewCell 인지 TableViewCell 인지 구분할 수 있도록 cell 클래스명 변경 ### Related Issue close #45 --- popo/popo.xcodeproj/project.pbxproj | 48 +++++++++---------- popo/popo/Resources/Constant/Xib.swift | 6 +-- ... => ConceptSelectCollectionViewCell.swift} | 4 +- ...ib => ConceptSelectCollectionViewCell.xib} | 2 +- ...ift => OnboardingCollectionViewCell.swift} | 2 +- ...l.xib => OnboardingCollectionViewCell.xib} | 7 +-- ...swift => CategoryCollectionViewCell.swift} | 2 +- ...ell.xib => CategoryCollectionViewCell.xib} | 2 +- .../ConceptSelectViewController.swift | 8 ++-- .../Onboarding/CoverColorViewController.swift | 6 +-- .../CoverGradientViewController.swift | 10 ++-- .../Onboarding/OnboardingViewController.swift | 10 ++-- .../PopoConcept/CategoryViewController.swift | 10 ++-- 13 files changed, 59 insertions(+), 58 deletions(-) rename popo/popo/Sources/Cell/Onboarding/{ConceptSelectCell.swift => ConceptSelectCollectionViewCell.swift} (79%) rename popo/popo/Sources/Cell/Onboarding/{ConceptSelectCell.xib => ConceptSelectCollectionViewCell.xib} (96%) rename popo/popo/Sources/Cell/Onboarding/{OnboardingCell.swift => OnboardingCollectionViewCell.swift} (96%) rename popo/popo/Sources/Cell/Onboarding/{OnboardingCell.xib => OnboardingCollectionViewCell.xib} (96%) rename popo/popo/Sources/Cell/PopoConcept/{CategoryCell.swift => CategoryCollectionViewCell.swift} (93%) rename popo/popo/Sources/Cell/PopoConcept/{CategoryCell.xib => CategoryCollectionViewCell.xib} (98%) diff --git a/popo/popo.xcodeproj/project.pbxproj b/popo/popo.xcodeproj/project.pbxproj index 2bf986e..af9509e 100644 --- a/popo/popo.xcodeproj/project.pbxproj +++ b/popo/popo.xcodeproj/project.pbxproj @@ -38,18 +38,18 @@ F8731B02265BE4B400770760 /* Onboarding.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F8731B01265BE4B400770760 /* Onboarding.storyboard */; }; F8731B0A265C019200770760 /* ConceptSelectViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8731B09265C019200770760 /* ConceptSelectViewController.swift */; }; F8731B0C265C01A800770760 /* ConceptSelect.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F8731B0B265C01A800770760 /* ConceptSelect.storyboard */; }; - F8731B0F265C05E900770760 /* ConceptSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8731B0D265C05E900770760 /* ConceptSelectCell.swift */; }; - F8731B10265C05E900770760 /* ConceptSelectCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F8731B0E265C05E900770760 /* ConceptSelectCell.xib */; }; + F8731B0F265C05E900770760 /* ConceptSelectCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8731B0D265C05E900770760 /* ConceptSelectCollectionViewCell.swift */; }; + F8731B10265C05E900770760 /* ConceptSelectCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F8731B0E265C05E900770760 /* ConceptSelectCollectionViewCell.xib */; }; F873648226A668DE00F121DC /* OnboardingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F873648126A668DE00F121DC /* OnboardingViewController.swift */; }; - F873648526A6A5E500F121DC /* OnboardingCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F873648326A6A5E500F121DC /* OnboardingCell.swift */; }; - F873648626A6A5E500F121DC /* OnboardingCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F873648426A6A5E500F121DC /* OnboardingCell.xib */; }; + F873648526A6A5E500F121DC /* OnboardingCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F873648326A6A5E500F121DC /* OnboardingCollectionViewCell.swift */; }; + F873648626A6A5E500F121DC /* OnboardingCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F873648426A6A5E500F121DC /* OnboardingCollectionViewCell.xib */; }; F873648B26A6A92600F121DC /* OnboardingDescriptionModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = F873648A26A6A92600F121DC /* OnboardingDescriptionModel.swift */; }; F881A73E26FC191400AEE21E /* ConceptData.swift in Sources */ = {isa = PBXBuildFile; fileRef = F881A73D26FC191400AEE21E /* ConceptData.swift */; }; F881A74026FC50B200AEE21E /* GenericResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = F881A73F26FC50B200AEE21E /* GenericResponse.swift */; }; F881A74226FC588400AEE21E /* NetworkResult.swift in Sources */ = {isa = PBXBuildFile; fileRef = F881A74126FC588400AEE21E /* NetworkResult.swift */; }; F8967D8E26F9FA6100F034E3 /* CategoryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8967D8C26F9FA6100F034E3 /* CategoryViewController.swift */; }; - F8967D9326FA01F300F034E3 /* CategoryCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8967D9126FA01F300F034E3 /* CategoryCell.swift */; }; - F8967D9426FA01F300F034E3 /* CategoryCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F8967D9226FA01F300F034E3 /* CategoryCell.xib */; }; + F8967D9326FA01F300F034E3 /* CategoryCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8967D9126FA01F300F034E3 /* CategoryCollectionViewCell.swift */; }; + F8967D9426FA01F300F034E3 /* CategoryCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = F8967D9226FA01F300F034E3 /* CategoryCollectionViewCell.xib */; }; F8967D9626FA090500F034E3 /* Category.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F8967D9526FA090500F034E3 /* Category.storyboard */; }; F8C284DC265CCD2300B41054 /* CoverColor.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F8C284DB265CCD2300B41054 /* CoverColor.storyboard */; }; F8C284DE265CCD4500B41054 /* CoverColorViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8C284DD265CCD4500B41054 /* CoverColorViewController.swift */; }; @@ -93,18 +93,18 @@ F8731B01265BE4B400770760 /* Onboarding.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Onboarding.storyboard; sourceTree = ""; }; F8731B09265C019200770760 /* ConceptSelectViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConceptSelectViewController.swift; sourceTree = ""; }; F8731B0B265C01A800770760 /* ConceptSelect.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = ConceptSelect.storyboard; sourceTree = ""; }; - F8731B0D265C05E900770760 /* ConceptSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConceptSelectCell.swift; sourceTree = ""; }; - F8731B0E265C05E900770760 /* ConceptSelectCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ConceptSelectCell.xib; sourceTree = ""; }; + F8731B0D265C05E900770760 /* ConceptSelectCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConceptSelectCollectionViewCell.swift; sourceTree = ""; }; + F8731B0E265C05E900770760 /* ConceptSelectCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ConceptSelectCollectionViewCell.xib; sourceTree = ""; }; F873648126A668DE00F121DC /* OnboardingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingViewController.swift; sourceTree = ""; }; - F873648326A6A5E500F121DC /* OnboardingCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingCell.swift; sourceTree = ""; }; - F873648426A6A5E500F121DC /* OnboardingCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OnboardingCell.xib; sourceTree = ""; }; + F873648326A6A5E500F121DC /* OnboardingCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingCollectionViewCell.swift; sourceTree = ""; }; + F873648426A6A5E500F121DC /* OnboardingCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OnboardingCollectionViewCell.xib; sourceTree = ""; }; F873648A26A6A92600F121DC /* OnboardingDescriptionModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingDescriptionModel.swift; sourceTree = ""; }; F881A73D26FC191400AEE21E /* ConceptData.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConceptData.swift; sourceTree = ""; }; F881A73F26FC50B200AEE21E /* GenericResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenericResponse.swift; sourceTree = ""; }; F881A74126FC588400AEE21E /* NetworkResult.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NetworkResult.swift; sourceTree = ""; }; F8967D8C26F9FA6100F034E3 /* CategoryViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryViewController.swift; sourceTree = ""; }; - F8967D9126FA01F300F034E3 /* CategoryCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryCell.swift; sourceTree = ""; }; - F8967D9226FA01F300F034E3 /* CategoryCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CategoryCell.xib; sourceTree = ""; }; + F8967D9126FA01F300F034E3 /* CategoryCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CategoryCollectionViewCell.swift; sourceTree = ""; }; + F8967D9226FA01F300F034E3 /* CategoryCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CategoryCollectionViewCell.xib; sourceTree = ""; }; F8967D9526FA090500F034E3 /* Category.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Category.storyboard; sourceTree = ""; }; F8C284DB265CCD2300B41054 /* CoverColor.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = CoverColor.storyboard; sourceTree = ""; }; F8C284DD265CCD4500B41054 /* CoverColorViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CoverColorViewController.swift; sourceTree = ""; }; @@ -305,10 +305,10 @@ F873648726A6A60100F121DC /* Onboarding */ = { isa = PBXGroup; children = ( - F873648326A6A5E500F121DC /* OnboardingCell.swift */, - F873648426A6A5E500F121DC /* OnboardingCell.xib */, - F8731B0D265C05E900770760 /* ConceptSelectCell.swift */, - F8731B0E265C05E900770760 /* ConceptSelectCell.xib */, + F873648326A6A5E500F121DC /* OnboardingCollectionViewCell.swift */, + F873648426A6A5E500F121DC /* OnboardingCollectionViewCell.xib */, + F8731B0D265C05E900770760 /* ConceptSelectCollectionViewCell.swift */, + F8731B0E265C05E900770760 /* ConceptSelectCollectionViewCell.xib */, ); path = Onboarding; sourceTree = ""; @@ -392,8 +392,8 @@ F8967D9026FA01C400F034E3 /* PopoConcept */ = { isa = PBXGroup; children = ( - F8967D9126FA01F300F034E3 /* CategoryCell.swift */, - F8967D9226FA01F300F034E3 /* CategoryCell.xib */, + F8967D9126FA01F300F034E3 /* CategoryCollectionViewCell.swift */, + F8967D9226FA01F300F034E3 /* CategoryCollectionViewCell.xib */, ); path = PopoConcept; sourceTree = ""; @@ -463,12 +463,12 @@ 562F555926452103000F8CAB /* LaunchScreen.storyboard in Resources */, F8731B02265BE4B400770760 /* Onboarding.storyboard in Resources */, 562F556C26452208000F8CAB /* Colors.xcassets in Resources */, - F8967D9426FA01F300F034E3 /* CategoryCell.xib in Resources */, + F8967D9426FA01F300F034E3 /* CategoryCollectionViewCell.xib in Resources */, F8967D9626FA090500F034E3 /* Category.storyboard in Resources */, F8731B0C265C01A800770760 /* ConceptSelect.storyboard in Resources */, F8C284DC265CCD2300B41054 /* CoverColor.storyboard in Resources */, - F8731B10265C05E900770760 /* ConceptSelectCell.xib in Resources */, - F873648626A6A5E500F121DC /* OnboardingCell.xib in Resources */, + F8731B10265C05E900770760 /* ConceptSelectCollectionViewCell.xib in Resources */, + F873648626A6A5E500F121DC /* OnboardingCollectionViewCell.xib in Resources */, 56924E07265635DA00745273 /* LoginMethod.storyboard in Resources */, 562F555626452103000F8CAB /* Assets.xcassets in Resources */, F8C284E0265CD4DE00B41054 /* CoverGradient.storyboard in Resources */, @@ -559,9 +559,9 @@ 562F556E26452218000F8CAB /* Const.swift in Sources */, F873648B26A6A92600F121DC /* OnboardingDescriptionModel.swift in Sources */, F8967D8E26F9FA6100F034E3 /* CategoryViewController.swift in Sources */, - F8731B0F265C05E900770760 /* ConceptSelectCell.swift in Sources */, + F8731B0F265C05E900770760 /* ConceptSelectCollectionViewCell.swift in Sources */, F873648226A668DE00F121DC /* OnboardingViewController.swift in Sources */, - F8967D9326FA01F300F034E3 /* CategoryCell.swift in Sources */, + F8967D9326FA01F300F034E3 /* CategoryCollectionViewCell.swift in Sources */, F8C284E2265CD4EB00B41054 /* CoverGradientViewController.swift in Sources */, F816E65A26FC62FD000C0270 /* PopoService.swift in Sources */, F881A73E26FC191400AEE21E /* ConceptData.swift in Sources */, @@ -572,7 +572,7 @@ F881A74226FC588400AEE21E /* NetworkResult.swift in Sources */, 567BF24A265A626100285956 /* Storyboard.swift in Sources */, 567840FD265E211300BDBF26 /* UINavigationController+Extension.swift in Sources */, - F873648526A6A5E500F121DC /* OnboardingCell.swift in Sources */, + F873648526A6A5E500F121DC /* OnboardingCollectionViewCell.swift in Sources */, 562F554F26452101000F8CAB /* SceneDelegate.swift in Sources */, 5686FA4E265A728600B7B9D5 /* CoverUserPhotoViewController.swift in Sources */, ); diff --git a/popo/popo/Resources/Constant/Xib.swift b/popo/popo/Resources/Constant/Xib.swift index cdecc28..f8b372a 100644 --- a/popo/popo/Resources/Constant/Xib.swift +++ b/popo/popo/Resources/Constant/Xib.swift @@ -9,8 +9,8 @@ import Foundation extension Const { struct Xib { - static let CategoryCell = "CategoryCell" - static let OnboardingCell = "OnboardingCell" - static let ConceptSelectCell = "ConceptSelectCell" + static let categoryCell = "CategoryCollectionViewCell" + static let onboardingCell = "OnboardingCollectionViewCell" + static let conceptSelectCell = "ConceptSelectCollectionViewCell" } } diff --git a/popo/popo/Sources/Cell/Onboarding/ConceptSelectCell.swift b/popo/popo/Sources/Cell/Onboarding/ConceptSelectCollectionViewCell.swift similarity index 79% rename from popo/popo/Sources/Cell/Onboarding/ConceptSelectCell.swift rename to popo/popo/Sources/Cell/Onboarding/ConceptSelectCollectionViewCell.swift index f38404c..fe7673c 100644 --- a/popo/popo/Sources/Cell/Onboarding/ConceptSelectCell.swift +++ b/popo/popo/Sources/Cell/Onboarding/ConceptSelectCollectionViewCell.swift @@ -7,7 +7,7 @@ import UIKit -class ConceptSelectCell: UICollectionViewCell { +class ConceptSelectCollectionViewCell: UICollectionViewCell { @IBOutlet weak var backImage: UIImageView! @@ -19,7 +19,7 @@ class ConceptSelectCell: UICollectionViewCell { // MARK: - Methods - func setBackgroundImage(image: String) { + func initBackgroundImage(image: String) { backImage.image = UIImage(named: image) backImage.sizeToFit() } diff --git a/popo/popo/Sources/Cell/Onboarding/ConceptSelectCell.xib b/popo/popo/Sources/Cell/Onboarding/ConceptSelectCollectionViewCell.xib similarity index 96% rename from popo/popo/Sources/Cell/Onboarding/ConceptSelectCell.xib rename to popo/popo/Sources/Cell/Onboarding/ConceptSelectCollectionViewCell.xib index 85207b2..703129a 100644 --- a/popo/popo/Sources/Cell/Onboarding/ConceptSelectCell.xib +++ b/popo/popo/Sources/Cell/Onboarding/ConceptSelectCollectionViewCell.xib @@ -10,7 +10,7 @@ - + diff --git a/popo/popo/Sources/Cell/Onboarding/OnboardingCell.swift b/popo/popo/Sources/Cell/Onboarding/OnboardingCollectionViewCell.swift similarity index 96% rename from popo/popo/Sources/Cell/Onboarding/OnboardingCell.swift rename to popo/popo/Sources/Cell/Onboarding/OnboardingCollectionViewCell.swift index a601ef2..8bd3657 100644 --- a/popo/popo/Sources/Cell/Onboarding/OnboardingCell.swift +++ b/popo/popo/Sources/Cell/Onboarding/OnboardingCollectionViewCell.swift @@ -7,7 +7,7 @@ import UIKit -class OnboardingCell: UICollectionViewCell { +class OnboardingCollectionViewCell: UICollectionViewCell { // MARK: - @IBOutlet Properties diff --git a/popo/popo/Sources/Cell/Onboarding/OnboardingCell.xib b/popo/popo/Sources/Cell/Onboarding/OnboardingCollectionViewCell.xib similarity index 96% rename from popo/popo/Sources/Cell/Onboarding/OnboardingCell.xib rename to popo/popo/Sources/Cell/Onboarding/OnboardingCollectionViewCell.xib index b2ad6cc..3378ea4 100644 --- a/popo/popo/Sources/Cell/Onboarding/OnboardingCell.xib +++ b/popo/popo/Sources/Cell/Onboarding/OnboardingCollectionViewCell.xib @@ -1,15 +1,16 @@ - + - + + - + diff --git a/popo/popo/Sources/Cell/PopoConcept/CategoryCell.swift b/popo/popo/Sources/Cell/PopoConcept/CategoryCollectionViewCell.swift similarity index 93% rename from popo/popo/Sources/Cell/PopoConcept/CategoryCell.swift rename to popo/popo/Sources/Cell/PopoConcept/CategoryCollectionViewCell.swift index edfcc15..9d67e6a 100644 --- a/popo/popo/Sources/Cell/PopoConcept/CategoryCell.swift +++ b/popo/popo/Sources/Cell/PopoConcept/CategoryCollectionViewCell.swift @@ -7,7 +7,7 @@ import UIKit -class CategoryCell: UICollectionViewCell { +class CategoryCollectionViewCell: UICollectionViewCell { // MARK: - @IBOutlet Properties diff --git a/popo/popo/Sources/Cell/PopoConcept/CategoryCell.xib b/popo/popo/Sources/Cell/PopoConcept/CategoryCollectionViewCell.xib similarity index 98% rename from popo/popo/Sources/Cell/PopoConcept/CategoryCell.xib rename to popo/popo/Sources/Cell/PopoConcept/CategoryCollectionViewCell.xib index 8c5472b..48bc675 100644 --- a/popo/popo/Sources/Cell/PopoConcept/CategoryCell.xib +++ b/popo/popo/Sources/Cell/PopoConcept/CategoryCollectionViewCell.xib @@ -11,7 +11,7 @@ - + diff --git a/popo/popo/Sources/ViewController/Onboarding/ConceptSelectViewController.swift b/popo/popo/Sources/ViewController/Onboarding/ConceptSelectViewController.swift index 4cbba00..1c257a9 100644 --- a/popo/popo/Sources/ViewController/Onboarding/ConceptSelectViewController.swift +++ b/popo/popo/Sources/ViewController/Onboarding/ConceptSelectViewController.swift @@ -48,8 +48,8 @@ extension ConceptSelectViewController { private func registerCell() { conceptCollectionView.delegate = self conceptCollectionView.dataSource = self - let conceptCell = UINib(nibName: "ConceptSelectCell", bundle: nil) - conceptCollectionView.register(conceptCell, forCellWithReuseIdentifier: "ConceptSelectCell") + let conceptCell = UINib(nibName: Const.Xib.conceptSelectCell, bundle: nil) + conceptCollectionView.register(conceptCell, forCellWithReuseIdentifier: Const.Xib.conceptSelectCell) } } @@ -59,10 +59,10 @@ extension ConceptSelectViewController: UICollectionViewDataSource { } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Const.Xib.ConceptSelectCell, for: indexPath) as? ConceptSelectCell else { + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Const.Xib.conceptSelectCell, for: indexPath) as? ConceptSelectCollectionViewCell else { return UICollectionViewCell() } - cell.setBackgroundImage(image: conceptList[indexPath.row]) + cell.initBackgroundImage(image: conceptList[indexPath.row]) return cell } diff --git a/popo/popo/Sources/ViewController/Onboarding/CoverColorViewController.swift b/popo/popo/Sources/ViewController/Onboarding/CoverColorViewController.swift index f0ebd16..865f8c4 100644 --- a/popo/popo/Sources/ViewController/Onboarding/CoverColorViewController.swift +++ b/popo/popo/Sources/ViewController/Onboarding/CoverColorViewController.swift @@ -43,7 +43,7 @@ class CoverColorViewController: UIViewController { // MARK: - @IBAction Methods @IBAction func touchPopo(_ sender: Any) { - _ = coverColorViewList.map { $0.backgroundColor = setRandomColor() } + _ = coverColorViewList.map { $0.backgroundColor = initRandomColor() } } @IBAction func touchCompleteButton(_ sender: Any) { @@ -69,10 +69,10 @@ extension CoverColorViewController { // 온보딩과정에서 커버를 제공할 때 랜덤으로 색을 초기화할 것인지 우리가 어울리는 것을 제공할 것인지 // 우선 랜덤 적용 - _ = coverColorViewList.map { $0.backgroundColor = setRandomColor() } + _ = coverColorViewList.map { $0.backgroundColor = initRandomColor() } } - private func setRandomColor() -> UIColor { + private func initRandomColor() -> UIColor { let randomRed = CGFloat(drand48()) let randomGreen = CGFloat(drand48()) let randomBlue = CGFloat(drand48()) diff --git a/popo/popo/Sources/ViewController/Onboarding/CoverGradientViewController.swift b/popo/popo/Sources/ViewController/Onboarding/CoverGradientViewController.swift index d045571..8e032dd 100644 --- a/popo/popo/Sources/ViewController/Onboarding/CoverGradientViewController.swift +++ b/popo/popo/Sources/ViewController/Onboarding/CoverGradientViewController.swift @@ -44,7 +44,7 @@ class CoverGradientViewController: UIViewController { @IBAction func touchPopo(_ sender: Any) { - setRandomGradient() + initRandomGradient() } @IBAction func touchCompleteButton(_ sender: Any) { @@ -62,14 +62,14 @@ extension CoverGradientViewController { _ = coverGradientViewList.map { $0.layer.masksToBounds = true } - setRandomGradient() + initRandomGradient() completeButton.setTitle("완료", for: .normal) completeButton.setTitleColor(#colorLiteral(red: 0.5294117647, green: 0.4862745098, blue: 0.9333333333, alpha: 1), for: .normal) completeButton.titleLabel?.font = UIFont.systemFont(ofSize: 18) } - private func setRandomGradient() { + private func initRandomGradient() { // 온보딩과정에서 커버를 제공할 때 랜덤으로 색을 초기화할 것인지 우리가 어울리는 것을 제공할 것인지 // 우선 랜덤 적용 @@ -82,7 +82,7 @@ extension CoverGradientViewController { var gradientLayerList = [CALayer]() for _ in 1...2 { - randomColorList.append(setRandomColor()) + randomColorList.append(initRandomColor()) } gradientLayer.colors = randomColorList gradientLayerList.append(gradientLayer) @@ -90,7 +90,7 @@ extension CoverGradientViewController { } } - private func setRandomColor() -> CGColor { + private func initRandomColor() -> CGColor { let randomRed = CGFloat(drand48()) let randomGreen = CGFloat(drand48()) let randomBlue = CGFloat(drand48()) diff --git a/popo/popo/Sources/ViewController/Onboarding/OnboardingViewController.swift b/popo/popo/Sources/ViewController/Onboarding/OnboardingViewController.swift index c46b555..29214f0 100644 --- a/popo/popo/Sources/ViewController/Onboarding/OnboardingViewController.swift +++ b/popo/popo/Sources/ViewController/Onboarding/OnboardingViewController.swift @@ -36,7 +36,7 @@ class OnboardingViewController: UIViewController { super.viewDidLoad() setUI() registerCell() - setList() + initList() } } @@ -69,11 +69,11 @@ extension OnboardingViewController { private func registerCell() { onboardingCollectionView.delegate = self onboardingCollectionView.dataSource = self - let onboardingCell = UINib(nibName: Const.Xib.OnboardingCell, bundle: nil) - onboardingCollectionView.register(onboardingCell, forCellWithReuseIdentifier: Const.Xib.OnboardingCell) + let onboardingCell = UINib(nibName: Const.Xib.onboardingCell, bundle: nil) + onboardingCollectionView.register(onboardingCell, forCellWithReuseIdentifier: Const.Xib.onboardingCell) } - private func setList() { + private func initList() { onboardingList.append(contentsOf: [ OnboardingDescriptionModel(title: "주제별로 기록해요", subtitle: "12개의 컨셉을 선택해\n 각자 다른 주제의 포포를 만들어 보세요!", pageImage: "pageControllerImg1", image: "onboardingPhoneImg1"), OnboardingDescriptionModel(title: "한눈에 확인해요", subtitle: "각 포포에서 내가 기록한\n 썸네일을 한눈에 볼 수 있어요!", pageImage: "pageControllerImg2", image: "onboardingPhoneImg2"), @@ -121,7 +121,7 @@ extension OnboardingViewController: UICollectionViewDataSource { } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Const.Xib.OnboardingCell, for: indexPath) as? OnboardingCell else { + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Const.Xib.onboardingCell, for: indexPath) as? OnboardingCollectionViewCell else { return UICollectionViewCell() } cell.initCell(title: onboardingList[indexPath.row].title, subtitle: onboardingList[indexPath.row].subtitle, pageImage: onboardingList[indexPath.row].pageImage, imageView: onboardingList[indexPath.row].image) diff --git a/popo/popo/Sources/ViewController/PopoConcept/CategoryViewController.swift b/popo/popo/Sources/ViewController/PopoConcept/CategoryViewController.swift index 22aaa43..f189e13 100644 --- a/popo/popo/Sources/ViewController/PopoConcept/CategoryViewController.swift +++ b/popo/popo/Sources/ViewController/PopoConcept/CategoryViewController.swift @@ -23,7 +23,7 @@ class CategoryViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() setUI() - setCategoryList() + initCategoryList() registerCell() } @@ -42,7 +42,7 @@ extension CategoryViewController { categoryCollectionView.backgroundColor = .clear } - private func setCategoryList() { + private func initCategoryList() { categoryList.append(contentsOf: ["영화", "책", "음식", @@ -64,8 +64,8 @@ extension CategoryViewController { private func registerCell() { categoryCollectionView.delegate = self categoryCollectionView.dataSource = self - let cateogoryCell = UINib(nibName: Const.Xib.CategoryCell, bundle: nil) - categoryCollectionView.register(cateogoryCell, forCellWithReuseIdentifier: Const.Xib.CategoryCell) + let cateogoryCell = UINib(nibName: Const.Xib.categoryCell, bundle: nil) + categoryCollectionView.register(cateogoryCell, forCellWithReuseIdentifier: Const.Xib.categoryCell) } } @@ -79,7 +79,7 @@ extension CategoryViewController: UICollectionViewDataSource { } func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { - guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Const.Xib.CategoryCell, for: indexPath) as? CategoryCell else { + guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: Const.Xib.categoryCell, for: indexPath) as? CategoryCollectionViewCell else { return UICollectionViewCell() } cell.initCell(imageList[indexPath.row], categoryList[indexPath.row])