Skip to content
This repository has been archived by the owner on Jan 6, 2024. It is now read-only.

Commit

Permalink
refactor: 비밀번호 찾기 화면 내 label lineheight 적용 #82
Browse files Browse the repository at this point in the history
  • Loading branch information
llghdud921 committed Jul 25, 2022
1 parent 6ce275a commit 516a49a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 6 deletions.
35 changes: 35 additions & 0 deletions Weekand/Weekand/Presentation/Common/View/WMultiLineTextLabel.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//
// WMultiLineTextLabel.swift
// Weekand
//
// Created by 이호영 on 2022/07/25.
//

import UIKit

class WMultiLineTextLabel: UILabel {

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

required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
setupView()
}

func setupView() {
font = WFont.body1()
numberOfLines = 0
}

func setText(string: String) {
let attrString = NSMutableAttributedString(string: string)
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineHeightMultiple = 1.33
attrString.addAttribute(NSAttributedString.Key.paragraphStyle, value: paragraphStyle, range: NSMakeRange(0, attrString.length))
attributedText = attrString
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,9 @@ class PasswordFindViewController: UIViewController {
$0.numberOfLines = 0
}

lazy var informLabel = WTextLabel().then {
$0.text = "작성하신 이메일로 임시 비밀번호를 보내드려요.\n임시 비밀번호로 로그인하신 후에 \n계정관리에서 비밀번호를 변경해주세요."
$0.font = WFont.subHead2()
lazy var informLabel = WMultiLineTextLabel().then {
$0.setText(string: "작성하신 이메일로 임시 비밀번호를 보내드려요.\n임시 비밀번호로 로그인하신 후에 \n계정관리에서 비밀번호를 변경해주세요.")
$0.textColor = .gray600
$0.numberOfLines = 0
}

lazy var emailField = WTextField(placeHolder: "이메일을 입력해주세요")
Expand All @@ -53,6 +51,12 @@ class PasswordFindViewController: UIViewController {
bindViewModel()
}

override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
super.touchesBegan(touches, with: event)

self.view.endEditing(true)
}

private func setupView() {
view.backgroundColor = .white
navigationItem.leftBarButtonItem = closeButton
Expand All @@ -73,7 +77,7 @@ class PasswordFindViewController: UIViewController {

self.view.addSubview(textFieldStack)
textFieldStack.snp.makeConstraints { make in
make.top.equalTo(informLabel.snp.bottom).offset(60)
make.top.equalTo(informLabel.snp.bottom).offset(50)
make.leading.equalToSuperview().offset(24)
make.trailing.equalToSuperview().offset(-24)
}
Expand All @@ -86,7 +90,7 @@ class PasswordFindViewController: UIViewController {
closeButtonDidTapEvent: closeButton.rx.tap.asObservable()
)

let output = viewModel?.transform(input: input)
let _ = viewModel?.transform(input: input)
}

}

0 comments on commit 516a49a

Please sign in to comment.