Skip to content

Commit

Permalink
πŸ’„[MOD] #139 textfield UI μ™„λ£Œ
Browse files Browse the repository at this point in the history
  • Loading branch information
comeheredart committed Sep 25, 2021
1 parent ad82259 commit 6f2a077
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,13 @@ class JoinViewCVC: UICollectionViewCell {

static let identifier = "JoinViewCVC"

override init(frame: CGRect) {
super.init(frame: frame)
}



required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
62 changes: 55 additions & 7 deletions ChaRo-iOS/ChaRo-iOS/Source/Views/VCs/SignScene/JoinVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ class JoinVC: UIViewController {
var collectionView: UICollectionView = {
let flowLayout = UICollectionViewFlowLayout()
let cv = UICollectionView.init(frame: .zero, collectionViewLayout: flowLayout)
cv.backgroundColor = .red
return cv
}()

Expand All @@ -36,12 +35,23 @@ class JoinVC: UIViewController {
}

var upperTextField = UITextField().then {
$0.placeholder = "Ex"
$0.placeholder = "ex)[email protected]"
$0.backgroundColor = .gray10
$0.clipsToBounds = true
$0.layer.cornerRadius = 10
$0.layer.borderWidth = 1
$0.layer.borderColor = UIColor.gray20.cgColor
$0.addLeftPadding(14)
$0.clearButtonMode = .whileEditing
}

var viewVer1 = UIView().then {
$0.backgroundColor = .blue

var EmailView = UIView().then {
$0.backgroundColor = .white
}

var verifyEmailView = UIView().then {
$0.backgroundColor = .white
}


Expand Down Expand Up @@ -79,6 +89,43 @@ class JoinVC: UIViewController {
$0.top.equalToSuperview().offset(180)
$0.bottom.leading.trailing.equalToSuperview()
}

configureVerifyEmailView()

}

private func configureEmailView() {

EmailView.snp.makeConstraints {
$0.top.bottom.leading.trailing.equalToSuperview()
}

EmailView.addSubview(upperLabel)
EmailView.addSubview(upperSubLabel)
EmailView.addSubview(upperTextField)

upperLabel.snp.makeConstraints {
$0.top.equalToSuperview()
$0.leading.equalToSuperview().offset(20)
$0.trailing.equalToSuperview().offset(-20)
}

upperSubLabel.snp.makeConstraints {
$0.top.equalTo(upperLabel.snp.bottom).offset(2)
$0.leading.trailing.equalTo(upperLabel)
}

upperTextField.snp.makeConstraints {
$0.top.equalTo(upperSubLabel.snp.bottom).offset(12)
$0.leading.trailing.equalTo(upperLabel)
$0.height.equalTo(48)
}

EmailView.dismissKeyboardWhenTappedAround()
}

private func configureVerifyEmailView() {

}


Expand All @@ -98,8 +145,9 @@ extension JoinVC: UICollectionViewDataSource {
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {

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

Expand All @@ -113,6 +161,6 @@ 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)
return CGSize(width: view.frame.width, height: view.frame.height - 250)
}
}

0 comments on commit 6f2a077

Please sign in to comment.