Skip to content

Commit

Permalink
[Feat] sopt-makers#12 - 닉네임, 이메일 텍스트필드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
lsj8706 committed Nov 28, 2022
1 parent 5e11790 commit 1fd6be1
Showing 1 changed file with 58 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,40 @@ import SnapKit
import Then

import Core
import DSKit

public class SignUpVC: UIViewController {

// MARK: - Properties

public var factory: ModuleFactoryInterface!
public var viewModel: SignUpViewModel!
private var cancelBag = CancelBag()

// MARK: - UI Components


private let scrollView = UIScrollView()
private let containerView = UIView()

private lazy var naviBar = CustomNavigationBar(self, type: .titleWithLeftButton)
.setTitle(I18N.SignUp.signUp)
.setTitleTypoStyle(.h1)

private let nickNameTextFieldView = CustomTextFieldView(type: .titleWithRightButton)
.setTitle(I18N.SignUp.nickname)
.setPlaceholder(I18N.SignUp.nicknameTextFieldPlaceholder)

private let emailTextFieldView = CustomTextFieldView(type: .titleWithRightButton)
.setTitle(I18N.SignUp.email)
.setPlaceholder(I18N.SignUp.emailTextFieldPlaceholder)

// MARK: - View Life Cycle

public override func viewDidLoad() {
super.viewDidLoad()
self.bindViewModels()
self.setUI()
self.setLayout()
}
}

Expand All @@ -39,5 +58,43 @@ extension SignUpVC {
let input = SignUpViewModel.Input()
let output = self.viewModel.transform(from: input, cancelBag: self.cancelBag)
}
}

// MARK: - UI & Layout

extension SignUpVC {

private func setUI() {
self.view.backgroundColor = .white
self.navigationController?.navigationBar.isHidden = true
}

private func setLayout() {
self.view.addSubview(scrollView)
scrollView.addSubview(containerView)
containerView.addSubviews(naviBar, nickNameTextFieldView, emailTextFieldView)

scrollView.snp.makeConstraints { make in
make.edges.equalTo(view.safeAreaLayoutGuide)
}

containerView.snp.makeConstraints { make in
make.edges.equalTo(scrollView.contentLayoutGuide)
make.width.equalTo(scrollView.snp.width)
}

naviBar.snp.makeConstraints { make in
make.leading.top.trailing.equalToSuperview()
}

nickNameTextFieldView.snp.makeConstraints { make in
make.top.equalTo(naviBar.snp.bottom).offset(58)
make.leading.trailing.equalToSuperview().inset(20)
}

emailTextFieldView.snp.makeConstraints { make in
make.top.equalTo(nickNameTextFieldView.snp.bottom).offset(72)
make.leading.trailing.equalToSuperview().inset(20)
}
}
}

0 comments on commit 1fd6be1

Please sign in to comment.