diff --git a/Weekand/Weekand/Presentation/Common/View/WMultiLineTextLabel.swift b/Weekand/Weekand/Presentation/Common/View/WMultiLineTextLabel.swift new file mode 100644 index 00000000..a3fffb9a --- /dev/null +++ b/Weekand/Weekand/Presentation/Common/View/WMultiLineTextLabel.swift @@ -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 + } + +} diff --git a/Weekand/Weekand/Presentation/SignScene/SignIn/View/PasswordFindViewController.swift b/Weekand/Weekand/Presentation/SignScene/SignIn/View/PasswordFindViewController.swift index 305dc9e8..2de4096c 100644 --- a/Weekand/Weekand/Presentation/SignScene/SignIn/View/PasswordFindViewController.swift +++ b/Weekand/Weekand/Presentation/SignScene/SignIn/View/PasswordFindViewController.swift @@ -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: "이메일을 입력해주세요") @@ -53,6 +51,12 @@ class PasswordFindViewController: UIViewController { bindViewModel() } + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + super.touchesBegan(touches, with: event) + + self.view.endEditing(true) + } + private func setupView() { view.backgroundColor = .white navigationItem.leftBarButtonItem = closeButton @@ -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) } @@ -86,7 +90,7 @@ class PasswordFindViewController: UIViewController { closeButtonDidTapEvent: closeButton.rx.tap.asObservable() ) - let output = viewModel?.transform(input: input) + let _ = viewModel?.transform(input: input) } }