Skip to content

Commit

Permalink
✨[FEAT] : #139 CollectionView 셀 크기 조정
Browse files Browse the repository at this point in the history
  • Loading branch information
comeheredart committed Sep 23, 2021
1 parent 2844b02 commit ad82259
Showing 1 changed file with 48 additions and 22 deletions.
70 changes: 48 additions & 22 deletions ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SignScene/JoinVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,51 @@ import Then
class JoinVC: UIViewController {

static let identifier = "JoinVC"
//private var collectionView: UICollectionView!

var collectionView = UICollectionView(frame: CGRect.zero, collectionViewLayout: UICollectionViewFlowLayout.init()).then {
$0.backgroundColor = .red
//MARK: - UI Variables
var collectionView: UICollectionView = {
let flowLayout = UICollectionViewFlowLayout()
let cv = UICollectionView.init(frame: .zero, collectionViewLayout: flowLayout)
cv.backgroundColor = .red
return cv
}()


var upperLabel = UILabel().then {
$0.text = "이메일 아이디"
$0.font = .notoSansBoldFont(ofSize: 17)
$0.textColor = .mainBlack
}
// var upperLabel = UILabel().then {
// $0.text = "이메일 아이디"
// $0.font = .notoSansBoldFont(ofSize: 17)
// $0.textColor = .mainBlack
// }
//
// var upperSubLabel = UILabel().then {
// $0.text = "사용할 이메일을 입력해주세요"
// $0.font = .notoSansRegularFont(ofSize: 11)
// $0.textColor = .gray40
// }
//
// var upperTextField = UITextField().then {
// $0.placeholder = "Ex"
// $0.backgroundColor = .gray10
// }

var upperSubLabel = UILabel().then {
$0.text = "사용할 이메일을 입력해주세요"
$0.font = .notoSansRegularFont(ofSize: 11)
$0.textColor = .gray40
}

var upperTextField = UITextField().then {
$0.placeholder = "Ex"
$0.backgroundColor = .gray10
}
var viewVer1 = UIView().then {
$0.backgroundColor = .blue
}


//MARK: - Life Cycle
override func viewDidLoad() {
super.viewDidLoad()
setupCollectionView()
configureUI()

}

override func viewWillAppear(_ animated: Bool) {
configureNavigationConrtroller()
}


//MARK: - private func
private func configureNavigationConrtroller() {
self.navigationController?.setNavigationBarHidden(false, animated: true)
//네비게이션 바 나타나게 하기
Expand All @@ -56,6 +68,7 @@ class JoinVC: UIViewController {
collectionView.dataSource = self

collectionView.register(JoinViewCVC.self, forCellWithReuseIdentifier: JoinViewCVC.identifier)

}

private func configureUI() {
Expand All @@ -73,7 +86,9 @@ class JoinVC: UIViewController {

}

extension JoinVC: UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {

//MARK: - Extension
extension JoinVC: UICollectionViewDataSource {

func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return 1
Expand All @@ -84,9 +99,20 @@ extension JoinVC: UICollectionViewDelegate, UICollectionViewDataSource, UICollec

guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: JoinViewCVC.identifier, for: indexPath) as? JoinViewCVC else { return UICollectionViewCell() }
cell.backgroundColor = .red

cell.backgroundView = viewVer1
return cell
}


}

extension JoinVC: UICollectionViewDelegate {

}


extension JoinVC: UICollectionViewDelegateFlowLayout {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: view.frame.width, height: view.frame.height)
}
}

0 comments on commit ad82259

Please sign in to comment.