Skip to content

Commit

Permalink
[FEAT][#2] 네비게이션 바 커스텀
Browse files Browse the repository at this point in the history
  • Loading branch information
dayo2n committed Feb 3, 2023
1 parent 41ff17c commit 592d060
Showing 1 changed file with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class CheckSecurityCodeController: UIViewController {
codeField.delegate = self

view.backgroundColor = .white
setNavCustom()
configureUI()
codeField.becomeFirstResponder()
}
Expand All @@ -55,7 +56,20 @@ class CheckSecurityCodeController: UIViewController {
}) }

// MARK: - Helpers
func configureUI() {

private func setNavCustom() {
let navBar = self.navigationController?.navigationBar
navBar?.tintColor = .black
navBar?.backIndicatorImage = UIImage(systemName: "arrow.left")
navBar?.backIndicatorTransitionMaskImage = UIImage(systemName: "arrow.left")
navBar?.topItem?.title = ""

let title = UILabel()
title.text = "회원가입"
self.navigationItem.titleView = title
}

private func configureUI() {
view.addSubview(guidePhrase)
guidePhrase.snp.makeConstraints { make in
make.top.equalTo(view.safeAreaLayoutGuide).offset(50)
Expand Down Expand Up @@ -89,7 +103,6 @@ extension CheckSecurityCodeController: UITextFieldDelegate {
guard let text = textField.text else { return false }
let maxLength: Int = 12

// 최대 글자수 이상을 입력한 이후에는 중간에 다른 글자를 추가할 수 없게끔 작동
if text.count >= maxLength && range.length == 0 && range.location <= maxLength {
return false
}
Expand Down

0 comments on commit 592d060

Please sign in to comment.