From cd930b5294f4d42aa499e6a6b29abd62fd06cf4f Mon Sep 17 00:00:00 2001 From: Gyuni Date: Mon, 23 Aug 2021 00:50:53 +0900 Subject: [PATCH] =?UTF-8?q?[#55]=20TextField=20=EA=B4=80=EB=A0=A8=20?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=A0=95=EB=A6=AC=20=EB=B0=8F=20=EC=83=98?= =?UTF-8?q?=ED=94=8C=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...asswordTextFieldSampleViewController.swift | 74 --------------- ...swordTextFieldViewPageViewController.swift | 87 ++++++++++++++++++ .../SearchBarPageViewController.swift | 53 +++++++++++ .../SearchBarSampleViewController.swift | 56 ----------- .../SearchTextFieldPageViewController.swift | 67 ++++++++++++++ .../SearchTextFieldSampleViewController.swift | 56 ----------- .../SimpleTextFieldSampleViewController.swift | 68 -------------- ...impleTextFieldViewPageViewController.swift | 87 ++++++++++++++++++ .../SuffixTextFieldSampleViewController.swift | 70 -------------- ...uffixTextFieldViewPageViewController.swift | 92 +++++++++++++++++++ YDS-Storybook/PageListViewController.swift | 11 ++- .../StorybookPageViewController.swift | 9 ++ YDS.xcodeproj/project.pbxproj | 40 ++++---- YDS/Source/Atom/YDSSearchBar.swift | 8 +- .../YDSPasswordTextField.swift | 7 +- 15 files changed, 425 insertions(+), 360 deletions(-) delete mode 100644 YDS-Storybook/AtomSampleViewController/PasswordTextFieldSampleViewController.swift create mode 100644 YDS-Storybook/AtomSampleViewController/PasswordTextFieldViewPageViewController.swift create mode 100644 YDS-Storybook/AtomSampleViewController/SearchBarPageViewController.swift delete mode 100644 YDS-Storybook/AtomSampleViewController/SearchBarSampleViewController.swift create mode 100644 YDS-Storybook/AtomSampleViewController/SearchTextFieldPageViewController.swift delete mode 100644 YDS-Storybook/AtomSampleViewController/SearchTextFieldSampleViewController.swift delete mode 100644 YDS-Storybook/AtomSampleViewController/SimpleTextFieldSampleViewController.swift create mode 100644 YDS-Storybook/AtomSampleViewController/SimpleTextFieldViewPageViewController.swift delete mode 100644 YDS-Storybook/AtomSampleViewController/SuffixTextFieldSampleViewController.swift create mode 100644 YDS-Storybook/AtomSampleViewController/SuffixTextFieldViewPageViewController.swift diff --git a/YDS-Storybook/AtomSampleViewController/PasswordTextFieldSampleViewController.swift b/YDS-Storybook/AtomSampleViewController/PasswordTextFieldSampleViewController.swift deleted file mode 100644 index 171a2b91..00000000 --- a/YDS-Storybook/AtomSampleViewController/PasswordTextFieldSampleViewController.swift +++ /dev/null @@ -1,74 +0,0 @@ -// -// PasswordTextFieldSampleVC.swift -// YDS-Sample -// -// Created by Gyuni on 2021/07/19. -// - -import UIKit -import YDS -import SnapKit - -class PasswordTextFieldSampleViewController: UIViewController, UITextFieldDelegate { - - let sampleTextField: YDSPasswordTextFieldView = { - let textField = YDSPasswordTextFieldView() - textField.fieldLabelText = "비밀번호" - textField.placeholder = "password1234!" - textField.helperLabelText = "알파벳과 숫자를 포함해서 8자 이상으로 입력해 주세요." - textField.isMasked = true - textField.isDisabled = false - textField.isNegative = false - textField.isPositive = false - return textField - }() - - override func viewDidLoad() { - super.viewDidLoad() - setUI() - } - - private func setUI(){ - self.view.backgroundColor = YDSColor.bgNormal - self.view.addSubview(sampleTextField) - sampleTextField.snp.makeConstraints { (make) in - make.centerX.equalToSuperview() - make.top.equalTo(self.view.safeAreaLayoutGuide.snp.top).offset(24) - make.leading.equalToSuperview().offset(20) - make.trailing.equalToSuperview().offset(-20) - } - - _ = sampleTextField.textField.becomeFirstResponder() - sampleTextField.textField.delegate = self - sampleTextField.textField.returnKeyType = .done - sampleTextField.textField.addTarget(self, action: #selector(self.textFieldDidChange(_:)), for: .editingChanged) - } - - override func touchesBegan(_ touches: Set, with event: UIEvent?) { - sampleTextField.textField.endEditing(true) - } - - @objc func textFieldDidChange(_ textField: UITextField) { - guard let text = textField.text else { return } - - let passwordRegex: String = #"^(?=.*[A-Za-z])(?=.*\d)[!-~₩]{8,100}$"# - let isFulfilled = NSPredicate(format: "SELF MATCHES %@", passwordRegex).evaluate(with: text) - - if text == "Disabled" { - self.sampleTextField.isDisabled = true - return - } else { - self.sampleTextField.isDisabled = false - } - - if text.count < 8 { - self.sampleTextField.isNegative = false - self.sampleTextField.isPositive = false - return - } - - self.sampleTextField.isPositive = isFulfilled - self.sampleTextField.isNegative = !isFulfilled - } - -} diff --git a/YDS-Storybook/AtomSampleViewController/PasswordTextFieldViewPageViewController.swift b/YDS-Storybook/AtomSampleViewController/PasswordTextFieldViewPageViewController.swift new file mode 100644 index 00000000..bd6ecd2d --- /dev/null +++ b/YDS-Storybook/AtomSampleViewController/PasswordTextFieldViewPageViewController.swift @@ -0,0 +1,87 @@ +// +// PasswordTextFieldViewPageViewController.swift +// YDS-Sample +// +// Created by Gyuni on 2021/08/23. +// + +import UIKit +import YDS +import SnapKit + +class PasswordTextFieldViewPageViewController: StoryBookViewController { + + let sampleTextFieldView: YDSPasswordTextFieldView = { + let textFieldView = YDSPasswordTextFieldView() + return textFieldView + }() + + override func viewDidLoad() { + super.viewDidLoad() + setupView() + addOptions() + } + + private func setupView() { + setViewProperty() + setViewHierarchy() + setAutolayout() + } + + private func setViewProperty() { + self.title = "PasswordTextFieldView" + self.sampleView.backgroundColor = YDSColor.bgNormal + } + + private func setViewHierarchy() { + sampleView.addSubview(sampleTextFieldView) + + } + + private func setAutolayout() { + sampleTextFieldView.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.leading.trailing.equalToSuperview().inset(20) + } + } + + private func addOptions() { + addOption(description: "fieldLabelText", + defaultValue: "비밀번호") { [weak self] value in + self?.sampleTextFieldView.fieldLabelText = value + } + + addOption(description: "placeholder", + defaultValue: "1q2w3e4r!") { [weak self] value in + self?.sampleTextFieldView.placeholder = value + } + + addOption(description: "helperLabelText", + defaultValue: "숫자와 영문자 조합으로 8자 이상 입력해 주세요.") { [weak self] value in + self?.sampleTextFieldView.helperLabelText = value + } + + addOption(description: "isDisabled", + defaultValue: false) { [weak self] value in + self?.sampleTextFieldView.isDisabled = value + } + + addOption(description: "isNegative", + defaultValue: false) { [weak self] value in + self?.sampleTextFieldView.isNegative = value + } + + addOption(description: "isPositive", + defaultValue: false) { [weak self] value in + self?.sampleTextFieldView.isPositive = value + } + } + + +} + +extension PasswordTextFieldViewPageViewController { + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + sampleTextFieldView.textField.endEditing(true) + } +} diff --git a/YDS-Storybook/AtomSampleViewController/SearchBarPageViewController.swift b/YDS-Storybook/AtomSampleViewController/SearchBarPageViewController.swift new file mode 100644 index 00000000..6a6ffaf0 --- /dev/null +++ b/YDS-Storybook/AtomSampleViewController/SearchBarPageViewController.swift @@ -0,0 +1,53 @@ +// +// SearchBarPageViewController.swift +// YDS-Sample +// +// Created by Gyuni on 2021/08/23. +// + +import UIKit +import YDS +import SnapKit + +class SearchBarPageViewController: StoryBookViewController { + + let sampleSearchBar: YDSSearchBar = { + let searchBar = YDSSearchBar() + return searchBar + }() + + override func viewDidLoad() { + super.viewDidLoad() + setupView() + addOptions() + self.extendedLayoutIncludesOpaqueBars = true + self.navigationItem.titleView = sampleSearchBar + } + + private func setupView() { + setViewProperty() + } + + private func setViewProperty() { + self.title = "SearchBar" + } + + private func addOptions() { + addOption(description: "placeholder", + defaultValue: "검색어를 입력해주세요.") { [weak self] value in + self?.sampleSearchBar.placeholder = value + } + + addOption(description: "isDisabled", + defaultValue: false) { [weak self] value in + self?.sampleSearchBar.isDisabled = value + } + } + +} + +extension SearchBarPageViewController { + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + sampleSearchBar.endEditing(true) + } +} diff --git a/YDS-Storybook/AtomSampleViewController/SearchBarSampleViewController.swift b/YDS-Storybook/AtomSampleViewController/SearchBarSampleViewController.swift deleted file mode 100644 index a98d97d2..00000000 --- a/YDS-Storybook/AtomSampleViewController/SearchBarSampleViewController.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// SearchBarSampleVC.swift -// YDS-Sample -// -// Created by Gyuni on 2021/07/20. -// - -import UIKit -import SnapKit -import YDS - -class SearchBarSampleViewController: UIViewController, UISearchBarDelegate { - - let sampleSearchBar: YDSSearchBar = { - let searchBar = YDSSearchBar() - searchBar.placeholder = "검색어를 입력해주세요." - searchBar.isDisabled = false - return searchBar - }() - - override func viewDidLoad() { - super.viewDidLoad() - setUI() - } - - private func setUI(){ - self.view.backgroundColor = YDSColor.bgNormal - - self.view.addSubview(sampleSearchBar) - sampleSearchBar.snp.makeConstraints { - $0.width.equalToSuperview() - $0.centerX.equalToSuperview() - $0.top.equalTo(self.view.safeAreaLayoutGuide.snp.top).offset(24) - } - - _ = sampleSearchBar.becomeFirstResponder() - sampleSearchBar.delegate = self - sampleSearchBar.returnKeyType = .done - sampleSearchBar.searchTextField.addTarget(self, action: #selector(self.textFieldDidChange(_:)), for: .editingChanged) - } - - override func touchesBegan(_ touches: Set, with event: UIEvent?) { - sampleSearchBar.endEditing(true) - } - - @objc func textFieldDidChange(_ textField: UITextField) { - guard let text = textField.text else { return } - - if text == "Disabled" { - sampleSearchBar.isDisabled = !sampleSearchBar.isDisabled - return - } - - } - -} diff --git a/YDS-Storybook/AtomSampleViewController/SearchTextFieldPageViewController.swift b/YDS-Storybook/AtomSampleViewController/SearchTextFieldPageViewController.swift new file mode 100644 index 00000000..b3a20b14 --- /dev/null +++ b/YDS-Storybook/AtomSampleViewController/SearchTextFieldPageViewController.swift @@ -0,0 +1,67 @@ +// +// SearchTextFieldPageViewController.swift +// YDS-Sample +// +// Created by Gyuni on 2021/08/23. +// + +import UIKit +import YDS +import SnapKit + +class SearchTextFieldPageViewController: StoryBookViewController { + + let sampleTextField: YDSSearchTextField = { + let textField = YDSSearchTextField() + return textField + }() + + override func viewDidLoad() { + super.viewDidLoad() + setupView() + addOptions() + } + + private func setupView() { + setViewProperty() + setViewHierarchy() + setAutolayout() + } + + private func setViewProperty() { + self.title = "SearchTextField" + self.sampleView.backgroundColor = YDSColor.bgNormal + } + + private func setViewHierarchy() { + sampleView.addSubview(sampleTextField) + + } + + private func setAutolayout() { + sampleTextField.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.leading.trailing.equalToSuperview().inset(20) + } + } + + private func addOptions() { + addOption(description: "placeholder", + defaultValue: "검색어를 입력해주세요.") { [weak self] value in + self?.sampleTextField.placeholder = value + } + + addOption(description: "isDisabled", + defaultValue: false) { [weak self] value in + self?.sampleTextField.isDisabled = value + } + } + + +} + +extension SearchTextFieldPageViewController { + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + sampleTextField.endEditing(true) + } +} diff --git a/YDS-Storybook/AtomSampleViewController/SearchTextFieldSampleViewController.swift b/YDS-Storybook/AtomSampleViewController/SearchTextFieldSampleViewController.swift deleted file mode 100644 index 4711ac95..00000000 --- a/YDS-Storybook/AtomSampleViewController/SearchTextFieldSampleViewController.swift +++ /dev/null @@ -1,56 +0,0 @@ -// -// SearchTextFieldSampleVC.swift -// YDS-Sample -// -// Created by Gyuni on 2021/07/20. -// - -import UIKit -import SnapKit -import YDS - -class SearchTextFieldSampleViewController: UIViewController, UITextFieldDelegate { - - let sampleTextField: YDSSearchTextField = { - let sampleTextField = YDSSearchTextField() - sampleTextField.placeholder = "검색어를 입력해주세요." - sampleTextField.isDisabled = false - return sampleTextField - }() - - override func viewDidLoad() { - super.viewDidLoad() - setUI() - } - - private func setUI(){ - self.view.backgroundColor = YDSColor.bgNormal - - self.view.addSubview(sampleTextField) - sampleTextField.snp.makeConstraints { - $0.width.equalToSuperview().offset(-32) - $0.centerX.equalToSuperview() - $0.top.equalTo(self.view.safeAreaLayoutGuide.snp.top).offset(24) - } - - _ = sampleTextField.becomeFirstResponder() - sampleTextField.delegate = self - sampleTextField.returnKeyType = .done - sampleTextField.addTarget(self, action: #selector(self.textFieldDidChange(_:)), for: .editingChanged) - } - - override func touchesBegan(_ touches: Set, with event: UIEvent?) { - sampleTextField.endEditing(true) - } - - @objc func textFieldDidChange(_ textField: UITextField) { - guard let text = textField.text else { return } - - if text == "Disabled" { - sampleTextField.isDisabled = !sampleTextField.isDisabled - return - } - - } - -} diff --git a/YDS-Storybook/AtomSampleViewController/SimpleTextFieldSampleViewController.swift b/YDS-Storybook/AtomSampleViewController/SimpleTextFieldSampleViewController.swift deleted file mode 100644 index d0f8160c..00000000 --- a/YDS-Storybook/AtomSampleViewController/SimpleTextFieldSampleViewController.swift +++ /dev/null @@ -1,68 +0,0 @@ -// -// ViewController.swift -// YDS-Sample -// -// Created by 김윤서 on 2021/06/11. -// - -import UIKit -import YDS -import SnapKit - -class SimpleTextFieldSampleViewController: UIViewController, UITextFieldDelegate { - - let sampleTextField: YDSSimpleTextFieldView = { - let textField = YDSSimpleTextFieldView() - textField.fieldLabelText = "닉네임" - textField.placeholder = "John Doe" - textField.helperLabelText = "이상한거 쓰지 마세요." - textField.isDisabled = false - textField.isNegative = false - textField.isPositive = false - return textField - }() - - override func viewDidLoad() { - super.viewDidLoad() - setUI() - } - - private func setUI(){ - self.view.backgroundColor = YDSColor.bgNormal - self.view.addSubview(sampleTextField) - sampleTextField.snp.makeConstraints { (make) in - make.centerX.equalToSuperview() - make.top.equalTo(self.view.safeAreaLayoutGuide.snp.top).offset(24) - make.leading.equalToSuperview().offset(20) - make.trailing.equalToSuperview().offset(-20) - } - - _ = sampleTextField.textField.becomeFirstResponder() - sampleTextField.textField.delegate = self - sampleTextField.textField.returnKeyType = .done - sampleTextField.textField.addTarget(self, action: #selector(self.textFieldDidChange(_:)), for: .editingChanged) - } - - override func touchesBegan(_ touches: Set, with event: UIEvent?) { - sampleTextField.textField.endEditing(true) - } - - @objc func textFieldDidChange(_ textField: UITextField) { - guard let text = textField.text else { return } - - if text == "Disabled" { - sampleTextField.isDisabled = !sampleTextField.isDisabled - return - } - - if text == "Negative" { - sampleTextField.isNegative = !sampleTextField.isNegative - return - } - - if text == "Positive" { - sampleTextField.isPositive = !sampleTextField.isPositive - return - } - } -} diff --git a/YDS-Storybook/AtomSampleViewController/SimpleTextFieldViewPageViewController.swift b/YDS-Storybook/AtomSampleViewController/SimpleTextFieldViewPageViewController.swift new file mode 100644 index 00000000..685401c0 --- /dev/null +++ b/YDS-Storybook/AtomSampleViewController/SimpleTextFieldViewPageViewController.swift @@ -0,0 +1,87 @@ +// +// SimpleTextFieldViewPageViewController.swift +// YDS-Sample +// +// Created by Gyuni on 2021/08/23. +// + +import UIKit +import YDS +import SnapKit + +class SimpleTextFieldViewPageViewController: StoryBookViewController { + + let sampleTextFieldView: YDSSimpleTextFieldView = { + let textFieldView = YDSSimpleTextFieldView() + return textFieldView + }() + + override func viewDidLoad() { + super.viewDidLoad() + setupView() + addOptions() + } + + private func setupView() { + setViewProperty() + setViewHierarchy() + setAutolayout() + } + + private func setViewProperty() { + self.title = "SimpleTextFieldView" + self.sampleView.backgroundColor = YDSColor.bgNormal + } + + private func setViewHierarchy() { + sampleView.addSubview(sampleTextFieldView) + + } + + private func setAutolayout() { + sampleTextFieldView.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.leading.trailing.equalToSuperview().inset(20) + } + } + + private func addOptions() { + addOption(description: "fieldLabelText", + defaultValue: "닉네임") { [weak self] value in + self?.sampleTextFieldView.fieldLabelText = value + } + + addOption(description: "placeholder", + defaultValue: "홍길동") { [weak self] value in + self?.sampleTextFieldView.placeholder = value + } + + addOption(description: "helperLabelText", + defaultValue: "닉네임은 20글자 이하로 해주세요.") { [weak self] value in + self?.sampleTextFieldView.helperLabelText = value + } + + addOption(description: "isDisabled", + defaultValue: false) { [weak self] value in + self?.sampleTextFieldView.isDisabled = value + } + + addOption(description: "isNegative", + defaultValue: false) { [weak self] value in + self?.sampleTextFieldView.isNegative = value + } + + addOption(description: "isPositive", + defaultValue: false) { [weak self] value in + self?.sampleTextFieldView.isPositive = value + } + } + + +} + +extension SuffixTextFieldViewPageViewController { + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + sampleTextFieldView.textField.endEditing(true) + } +} diff --git a/YDS-Storybook/AtomSampleViewController/SuffixTextFieldSampleViewController.swift b/YDS-Storybook/AtomSampleViewController/SuffixTextFieldSampleViewController.swift deleted file mode 100644 index f0a96c19..00000000 --- a/YDS-Storybook/AtomSampleViewController/SuffixTextFieldSampleViewController.swift +++ /dev/null @@ -1,70 +0,0 @@ -// -// SuffixTextFieldSampleVC.swift -// YDS-Sample -// -// Created by Gyuni on 2021/07/19. -// - -import UIKit -import YDS -import SnapKit - -class SuffixTextFieldSampleViewController: UIViewController, UITextFieldDelegate { - - let sampleTextField: YDSSuffixTextFieldView = { - let textField = YDSSuffixTextFieldView() - textField.fieldLabelText = "이메일" - textField.placeholder = "dinohan" - textField.helperLabelText = "이메일은 40글자 이상 80글자 이하여야 합니다." - textField.suffixLabelText = "@soongsil.ac.kr" - textField.isDisabled = false - textField.isNegative = false - textField.isPositive = false - return textField - }() - - override func viewDidLoad() { - super.viewDidLoad() - setUI() - } - - private func setUI(){ - self.view.backgroundColor = YDSColor.bgNormal - self.view.addSubview(sampleTextField) - sampleTextField.snp.makeConstraints { (make) in - make.centerX.equalToSuperview() - make.top.equalTo(self.view.safeAreaLayoutGuide.snp.top).offset(24) - make.leading.equalToSuperview().offset(20) - make.trailing.equalToSuperview().offset(-20) - } - - _ = sampleTextField.textField.becomeFirstResponder() - sampleTextField.textField.delegate = self - sampleTextField.textField.returnKeyType = .done - sampleTextField.textField.addTarget(self, action: #selector(self.textFieldDidChange(_:)), for: .editingChanged) - } - - override func touchesBegan(_ touches: Set, with event: UIEvent?) { - sampleTextField.textField.endEditing(true) - } - - @objc func textFieldDidChange(_ textField: UITextField) { - guard let text = textField.text else { return } - - if text == "Disabled" { - sampleTextField.isDisabled = !sampleTextField.isDisabled - return - } - - if text == "Negative" { - sampleTextField.isNegative = !sampleTextField.isNegative - return - } - - if text == "Positive" { - sampleTextField.isPositive = !sampleTextField.isPositive - return - } - } -} - diff --git a/YDS-Storybook/AtomSampleViewController/SuffixTextFieldViewPageViewController.swift b/YDS-Storybook/AtomSampleViewController/SuffixTextFieldViewPageViewController.swift new file mode 100644 index 00000000..52c888fe --- /dev/null +++ b/YDS-Storybook/AtomSampleViewController/SuffixTextFieldViewPageViewController.swift @@ -0,0 +1,92 @@ +// +// SuffixTextFieldViewPageViewController.swift +// YDS-Sample +// +// Created by Gyuni on 2021/08/23. +// + +import UIKit +import YDS +import SnapKit + +class SuffixTextFieldViewPageViewController: StoryBookViewController { + + let sampleTextFieldView: YDSSuffixTextFieldView = { + let textFieldView = YDSSuffixTextFieldView() + return textFieldView + }() + + override func viewDidLoad() { + super.viewDidLoad() + setupView() + addOptions() + } + + private func setupView() { + setViewProperty() + setViewHierarchy() + setAutolayout() + } + + private func setViewProperty() { + self.title = "SuffixTextFieldView" + self.sampleView.backgroundColor = YDSColor.bgNormal + } + + private func setViewHierarchy() { + sampleView.addSubview(sampleTextFieldView) + + } + + private func setAutolayout() { + sampleTextFieldView.snp.makeConstraints { + $0.centerY.equalToSuperview() + $0.leading.trailing.equalToSuperview().inset(20) + } + } + + private func addOptions() { + addOption(description: "fieldLabelText", + defaultValue: "학교 이메일") { [weak self] value in + self?.sampleTextFieldView.fieldLabelText = value + } + + addOption(description: "placeholder", + defaultValue: "아이디") { [weak self] value in + self?.sampleTextFieldView.placeholder = value + } + + addOption(description: "suffixLabelText", + defaultValue: "@soongsil.ac.kr") { [weak self] value in + self?.sampleTextFieldView.suffixLabelText = value + } + + addOption(description: "helperLabelText", + defaultValue: "이메일의 규칙은 어떠어떠합니다.") { [weak self] value in + self?.sampleTextFieldView.helperLabelText = value + } + + addOption(description: "isDisabled", + defaultValue: false) { [weak self] value in + self?.sampleTextFieldView.isDisabled = value + } + + addOption(description: "isNegative", + defaultValue: false) { [weak self] value in + self?.sampleTextFieldView.isNegative = value + } + + addOption(description: "isPositive", + defaultValue: false) { [weak self] value in + self?.sampleTextFieldView.isPositive = value + } + } + + +} + +extension SimpleTextFieldViewPageViewController { + override func touchesBegan(_ touches: Set, with event: UIEvent?) { + sampleTextFieldView.textField.endEditing(true) + } +} diff --git a/YDS-Storybook/PageListViewController.swift b/YDS-Storybook/PageListViewController.swift index f65d5574..93c5251b 100644 --- a/YDS-Storybook/PageListViewController.swift +++ b/YDS-Storybook/PageListViewController.swift @@ -42,11 +42,11 @@ class PageListViewController: UIViewController { Page(title: "BoxButton", vc: BoxButtonPageViewController.self), Page(title: "PlainButton", vc: PlainButtonPageViewController.self), Page(title: "Checkbox", vc: CheckboxPageViewController.self), - Page(title: "SimpleTextField", vc: SimpleTextFieldSampleViewController.self), - Page(title: "SuffixTextField", vc: SuffixTextFieldSampleViewController.self), - Page(title: "PasswordTextField", vc: PasswordTextFieldSampleViewController.self), - Page(title: "SearchTextField", vc: SearchTextFieldSampleViewController.self), - Page(title: "SearchBar", vc: SearchBarSampleViewController.self), + Page(title: "SimpleTextFieldView", vc: SimpleTextFieldViewPageViewController.self), + Page(title: "SuffixTextFieldView", vc: SuffixTextFieldViewPageViewController.self), + Page(title: "PasswordTextFieldView", vc: PasswordTextFieldViewPageViewController.self), + Page(title: "SearchTextField", vc: SearchTextFieldPageViewController.self), + Page(title: "SearchBar", vc: SearchBarPageViewController.self), ] let componentPages: [Page] = [ @@ -71,6 +71,7 @@ class PageListViewController: UIViewController { private func setupView() { view.backgroundColor = YDSColor.bgNormal + self.extendedLayoutIncludesOpaqueBars = true pageListTableView.dataSource = self pageListTableView.register(PageListTableViewCell.self, forCellReuseIdentifier: self.cellIdentifier) diff --git a/YDS-Storybook/Storybook/StorybookPageViewController.swift b/YDS-Storybook/Storybook/StorybookPageViewController.swift index d332c60e..60e8e95b 100644 --- a/YDS-Storybook/Storybook/StorybookPageViewController.swift +++ b/YDS-Storybook/Storybook/StorybookPageViewController.swift @@ -20,6 +20,8 @@ class StoryBookViewController: UIViewController { return view }() + let divider = YDSDivider(.horizontal) + let scrollView: UIScrollView = { let scrollView = UIScrollView() scrollView.backgroundColor = YDSColor.bgElevated @@ -50,6 +52,7 @@ class StoryBookViewController: UIViewController { private func setViewHierarchy() { self.view.addSubview(sampleView) self.view.addSubview(scrollView) + sampleView.addSubview(divider) scrollView.addSubview(stackView) } @@ -59,11 +62,17 @@ class StoryBookViewController: UIViewController { $0.leading.trailing.equalToSuperview() $0.height.equalTo(Screen.width * 3/4) } + + divider.snp.makeConstraints { + $0.bottom.leading.trailing.equalToSuperview() + } + scrollView.snp.makeConstraints { $0.top.equalTo(sampleView.snp.bottom) $0.leading.trailing.equalTo(self.view.safeAreaLayoutGuide) $0.bottom.equalToSuperview() } + scrollView.contentLayoutGuide.snp.makeConstraints { $0.top.equalTo(sampleView.snp.bottom) $0.leading.trailing.equalTo(self.view.safeAreaLayoutGuide) diff --git a/YDS.xcodeproj/project.pbxproj b/YDS.xcodeproj/project.pbxproj index 6e1e5d63..d5e321fd 100644 --- a/YDS.xcodeproj/project.pbxproj +++ b/YDS.xcodeproj/project.pbxproj @@ -30,11 +30,8 @@ 53441B0426AF287600CB6BC9 /* BoolControllerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53441B0326AF287600CB6BC9 /* BoolControllerView.swift */; }; 53443D8A26A5A4770037B02E /* YDSPasswordTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53443D8926A5A4770037B02E /* YDSPasswordTextField.swift */; }; 53443D8C26A5A4850037B02E /* YDSPasswordTextFieldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53443D8B26A5A4850037B02E /* YDSPasswordTextFieldView.swift */; }; - 53443D8E26A5A8C40037B02E /* PasswordTextFieldSampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53443D8D26A5A8C40037B02E /* PasswordTextFieldSampleViewController.swift */; }; - 53443D9026A5CC7E0037B02E /* SearchTextFieldSampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53443D8F26A5CC7E0037B02E /* SearchTextFieldSampleViewController.swift */; }; 53443D9226A5CD3E0037B02E /* YDSSearchTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53443D9126A5CD3E0037B02E /* YDSSearchTextField.swift */; }; 53443D9526A5D5DA0037B02E /* YDSSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53443D9426A5D5DA0037B02E /* YDSSearchBar.swift */; }; - 53443D9726A7000D0037B02E /* SearchBarSampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53443D9626A7000D0037B02E /* SearchBarSampleViewController.swift */; }; 53443D9E26A7D4BD0037B02E /* YDSBoxButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53443D9D26A7D4BD0037B02E /* YDSBoxButton.swift */; }; 5359111B269DDA31000CFFE7 /* YDSIconView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5359111A269DDA31000CFFE7 /* YDSIconView.swift */; }; 5359A5BD26BEC30300FCCECC /* YDSBottomBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5359A5BC26BEC30300FCCECC /* YDSBottomBarController.swift */; }; @@ -44,7 +41,6 @@ 536FCA50267CD25300158DFD /* YDSIcon.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 536FCA4F267CD25300158DFD /* YDSIcon.xcassets */; }; 5370918226A5463C007CD775 /* YDSSuffixTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5370918126A5463C007CD775 /* YDSSuffixTextField.swift */; }; 5370918426A5467D007CD775 /* YDSSuffixTextFieldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5370918326A5467D007CD775 /* YDSSuffixTextFieldView.swift */; }; - 5370918626A546DF007CD775 /* SuffixTextFieldSampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5370918526A546DF007CD775 /* SuffixTextFieldSampleViewController.swift */; }; 537A0ACE26C4188C00142DCE /* DoubleTitleTopBarSampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 537A0ACD26C4188C00142DCE /* DoubleTitleTopBarSampleViewController.swift */; }; 537A0AD026C4189700142DCE /* SingleTitleTopBarSampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 537A0ACF26C4189700142DCE /* SingleTitleTopBarSampleViewController.swift */; }; 537A0AD326C51DB000142DCE /* YDSButtonProtocol.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53C9F6F826B5546400EF7B86 /* YDSButtonProtocol.swift */; }; @@ -72,6 +68,11 @@ 53C9F70426B5BC1A00EF7B86 /* YDSProfileImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53C9F70326B5BC1A00EF7B86 /* YDSProfileImageView.swift */; }; 53C9F70626B5BCCE00EF7B86 /* ProfileImageViewPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53C9F70526B5BCCE00EF7B86 /* ProfileImageViewPageViewController.swift */; }; 53C9F70C26B67CE900EF7B86 /* YDSCheckbox.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53C9F70B26B67CE900EF7B86 /* YDSCheckbox.swift */; }; + 53E2CF3C26D29F62000DE005 /* SimpleTextFieldViewPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53E2CF3B26D29F62000DE005 /* SimpleTextFieldViewPageViewController.swift */; }; + 53E2CF3E26D2A1ED000DE005 /* SuffixTextFieldViewPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53E2CF3D26D2A1ED000DE005 /* SuffixTextFieldViewPageViewController.swift */; }; + 53E2CF4026D2A2B1000DE005 /* PasswordTextFieldViewPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53E2CF3F26D2A2B1000DE005 /* PasswordTextFieldViewPageViewController.swift */; }; + 53E2CF4226D2A3DA000DE005 /* SearchTextFieldPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53E2CF4126D2A3DA000DE005 /* SearchTextFieldPageViewController.swift */; }; + 53E2CF4426D2A462000DE005 /* SearchBarPageViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53E2CF4326D2A462000DE005 /* SearchBarPageViewController.swift */; }; 53EB943926A1E33A00208496 /* YDSDivider.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53EB943826A1E33A00208496 /* YDSDivider.swift */; }; 53EB9FF0269DC45D00B7D14A /* YDSIcon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53EB9FEF269DC45D00B7D14A /* YDSIcon.swift */; }; 53EFF5CE26BA9CD400732DCF /* YDSToast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 53EFF5CD26BA9CD400732DCF /* YDSToast.swift */; }; @@ -85,7 +86,6 @@ DDDC3C7A265E7072007ED3FE /* YDSBasicColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDDC3C79265E7072007ED3FE /* YDSBasicColor.swift */; }; DDDC3C82265E8276007ED3FE /* YDSSemanticColor.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDDC3C81265E8276007ED3FE /* YDSSemanticColor.swift */; }; DDFBCFFF26739A6900C5F409 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDFBCFFE26739A6900C5F409 /* AppDelegate.swift */; }; - DDFBD00326739A6900C5F409 /* SimpleTextFieldSampleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DDFBD00226739A6900C5F409 /* SimpleTextFieldSampleViewController.swift */; }; DDFBD00626739A6900C5F409 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DDFBD00426739A6900C5F409 /* Main.storyboard */; }; DDFBD00826739A6B00C5F409 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = DDFBD00726739A6B00C5F409 /* Assets.xcassets */; }; DDFBD00B26739A6B00C5F409 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DDFBD00926739A6B00C5F409 /* LaunchScreen.storyboard */; }; @@ -140,11 +140,8 @@ 53441B0326AF287600CB6BC9 /* BoolControllerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BoolControllerView.swift; sourceTree = ""; }; 53443D8926A5A4770037B02E /* YDSPasswordTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YDSPasswordTextField.swift; sourceTree = ""; }; 53443D8B26A5A4850037B02E /* YDSPasswordTextFieldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YDSPasswordTextFieldView.swift; sourceTree = ""; }; - 53443D8D26A5A8C40037B02E /* PasswordTextFieldSampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasswordTextFieldSampleViewController.swift; sourceTree = ""; }; - 53443D8F26A5CC7E0037B02E /* SearchTextFieldSampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchTextFieldSampleViewController.swift; sourceTree = ""; }; 53443D9126A5CD3E0037B02E /* YDSSearchTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YDSSearchTextField.swift; sourceTree = ""; }; 53443D9426A5D5DA0037B02E /* YDSSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YDSSearchBar.swift; sourceTree = ""; }; - 53443D9626A7000D0037B02E /* SearchBarSampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchBarSampleViewController.swift; sourceTree = ""; }; 53443D9D26A7D4BD0037B02E /* YDSBoxButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YDSBoxButton.swift; sourceTree = ""; }; 5359111A269DDA31000CFFE7 /* YDSIconView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YDSIconView.swift; sourceTree = ""; }; 5359A5BC26BEC30300FCCECC /* YDSBottomBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YDSBottomBarController.swift; sourceTree = ""; }; @@ -154,7 +151,6 @@ 536FCA4F267CD25300158DFD /* YDSIcon.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = YDSIcon.xcassets; sourceTree = ""; }; 5370918126A5463C007CD775 /* YDSSuffixTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YDSSuffixTextField.swift; sourceTree = ""; }; 5370918326A5467D007CD775 /* YDSSuffixTextFieldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YDSSuffixTextFieldView.swift; sourceTree = ""; }; - 5370918526A546DF007CD775 /* SuffixTextFieldSampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuffixTextFieldSampleViewController.swift; sourceTree = ""; }; 537A0ACD26C4188C00142DCE /* DoubleTitleTopBarSampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DoubleTitleTopBarSampleViewController.swift; sourceTree = ""; }; 537A0ACF26C4189700142DCE /* SingleTitleTopBarSampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SingleTitleTopBarSampleViewController.swift; sourceTree = ""; }; 537FFAA326C3E5C200270C22 /* TopBarPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TopBarPageViewController.swift; sourceTree = ""; }; @@ -180,6 +176,11 @@ 53C9F70326B5BC1A00EF7B86 /* YDSProfileImageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YDSProfileImageView.swift; sourceTree = ""; }; 53C9F70526B5BCCE00EF7B86 /* ProfileImageViewPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileImageViewPageViewController.swift; sourceTree = ""; }; 53C9F70B26B67CE900EF7B86 /* YDSCheckbox.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YDSCheckbox.swift; sourceTree = ""; }; + 53E2CF3B26D29F62000DE005 /* SimpleTextFieldViewPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleTextFieldViewPageViewController.swift; sourceTree = ""; }; + 53E2CF3D26D2A1ED000DE005 /* SuffixTextFieldViewPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuffixTextFieldViewPageViewController.swift; sourceTree = ""; }; + 53E2CF3F26D2A2B1000DE005 /* PasswordTextFieldViewPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PasswordTextFieldViewPageViewController.swift; sourceTree = ""; }; + 53E2CF4126D2A3DA000DE005 /* SearchTextFieldPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchTextFieldPageViewController.swift; sourceTree = ""; }; + 53E2CF4326D2A462000DE005 /* SearchBarPageViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchBarPageViewController.swift; sourceTree = ""; }; 53EB943826A1E33A00208496 /* YDSDivider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YDSDivider.swift; sourceTree = ""; }; 53EB9FEF269DC45D00B7D14A /* YDSIcon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YDSIcon.swift; sourceTree = ""; }; 53EFF5CD26BA9CD400732DCF /* YDSToast.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YDSToast.swift; sourceTree = ""; }; @@ -196,7 +197,6 @@ DDDC3C81265E8276007ED3FE /* YDSSemanticColor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YDSSemanticColor.swift; sourceTree = ""; }; DDFBCFFC26739A6900C5F409 /* YDS-Sample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "YDS-Sample.app"; sourceTree = BUILT_PRODUCTS_DIR; }; DDFBCFFE26739A6900C5F409 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - DDFBD00226739A6900C5F409 /* SimpleTextFieldSampleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SimpleTextFieldSampleViewController.swift; sourceTree = ""; }; DDFBD00526739A6900C5F409 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; DDFBD00726739A6B00C5F409 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; DDFBD00A26739A6B00C5F409 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; @@ -333,14 +333,14 @@ children = ( 53C445B026B92BEB00AAC753 /* CheckboxPageViewController.swift */, 53C9F70526B5BCCE00EF7B86 /* ProfileImageViewPageViewController.swift */, - DDFBD00226739A6900C5F409 /* SimpleTextFieldSampleViewController.swift */, - 5370918526A546DF007CD775 /* SuffixTextFieldSampleViewController.swift */, - 53443D8D26A5A8C40037B02E /* PasswordTextFieldSampleViewController.swift */, - 53443D8F26A5CC7E0037B02E /* SearchTextFieldSampleViewController.swift */, - 53443D9626A7000D0037B02E /* SearchBarSampleViewController.swift */, 5337939126AF0A7300BE5860 /* BoxButtonPageViewController.swift */, 53C9F6F626B54B4000EF7B86 /* PlainButtonPageViewController.swift */, 53C9F70126B5976700EF7B86 /* BadgePageViewController.swift */, + 53E2CF3B26D29F62000DE005 /* SimpleTextFieldViewPageViewController.swift */, + 53E2CF3D26D2A1ED000DE005 /* SuffixTextFieldViewPageViewController.swift */, + 53E2CF3F26D2A2B1000DE005 /* PasswordTextFieldViewPageViewController.swift */, + 53E2CF4126D2A3DA000DE005 /* SearchTextFieldPageViewController.swift */, + 53E2CF4326D2A462000DE005 /* SearchBarPageViewController.swift */, ); path = AtomSampleViewController; sourceTree = ""; @@ -670,10 +670,9 @@ 53441B0226AF248900CB6BC9 /* EnumControllerView.swift in Sources */, 5337939226AF0A7300BE5860 /* BoxButtonPageViewController.swift in Sources */, 5359A5C126BEC99700FCCECC /* BottomBarControllerPageViewController.swift in Sources */, - 53443D9726A7000D0037B02E /* SearchBarSampleViewController.swift in Sources */, - 5370918626A546DF007CD775 /* SuffixTextFieldSampleViewController.swift in Sources */, - DDFBD00326739A6900C5F409 /* SimpleTextFieldSampleViewController.swift in Sources */, 537FFAA426C3E5C200270C22 /* TopBarPageViewController.swift in Sources */, + 53E2CF3C26D29F62000DE005 /* SimpleTextFieldViewPageViewController.swift in Sources */, + 53E2CF4426D2A462000DE005 /* SearchBarPageViewController.swift in Sources */, 53C9F6FC26B5568600EF7B86 /* YDSIconArray.swift in Sources */, 53C9F6F726B54B4000EF7B86 /* PlainButtonPageViewController.swift in Sources */, 53C9F70226B5976700EF7B86 /* BadgePageViewController.swift in Sources */, @@ -686,17 +685,18 @@ 537A0AD026C4189700142DCE /* SingleTitleTopBarSampleViewController.swift in Sources */, 53EFF5D426BBC26900732DCF /* ToastPageViewController.swift in Sources */, 533A27B926A5351E009FD90A /* PageListTableViewCell.swift in Sources */, - 53443D9026A5CC7E0037B02E /* SearchTextFieldSampleViewController.swift in Sources */, 539110B426C049BD0094FD08 /* SingleTitleTopBarPageViewController.swift in Sources */, 5337939026AF0A0600BE5860 /* OptionalStringControllerView.swift in Sources */, 5337938E26AF09BF00BE5860 /* ControllerView.swift in Sources */, + 53E2CF4026D2A2B1000DE005 /* PasswordTextFieldViewPageViewController.swift in Sources */, + 53E2CF4226D2A3DA000DE005 /* SearchTextFieldPageViewController.swift in Sources */, 53C9F70626B5BCCE00EF7B86 /* ProfileImageViewPageViewController.swift in Sources */, 533A27B326A52E56009FD90A /* PageListViewController.swift in Sources */, 5359A5C526BED19900FCCECC /* DoubleTitleTopBarPageViewController.swift in Sources */, 53441B0426AF287600CB6BC9 /* BoolControllerView.swift in Sources */, + 53E2CF3E26D2A1ED000DE005 /* SuffixTextFieldViewPageViewController.swift in Sources */, 53441B0026AF233800CB6BC9 /* PickerControllerView.swift in Sources */, 5337938C26AF096A00BE5860 /* StorybookPageViewController.swift in Sources */, - 53443D8E26A5A8C40037B02E /* PasswordTextFieldSampleViewController.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/YDS/Source/Atom/YDSSearchBar.swift b/YDS/Source/Atom/YDSSearchBar.swift index cbee4b0d..16886fd1 100644 --- a/YDS/Source/Atom/YDSSearchBar.swift +++ b/YDS/Source/Atom/YDSSearchBar.swift @@ -43,9 +43,6 @@ public class YDSSearchBar: UISearchBar { /// 필드 내부 우측 마진값입니다. private static let rightMargin: CGFloat = 16 - /// 서치바 전체 높이입니다. - private static let searchBarHeight: CGFloat = 44 - /// searchIcon의 사이즈입니다. private static let searchIconSize: CGFloat = 16 @@ -69,6 +66,7 @@ public class YDSSearchBar: UISearchBar { /// view를 세팅합니다. private func setupView() { self.backgroundImage = UIImage() + self.setImage(YDSIcon.searchLine.resize(to: YDSSearchBar.searchIconSize), for: .search, state: .normal) self.directionalLayoutMargins = NSDirectionalEdgeInsets(top: 0, leading: YDSSearchBar.outsideLeftMargin, bottom: 0, @@ -85,10 +83,6 @@ public class YDSSearchBar: UISearchBar { self.setPositionAdjustment(UIOffset(horizontal: YDSSearchBar.leftMargin - YDSSearchBar.searchIconDefaultLeftMargin, vertical: 0), for: .search) self.setPositionAdjustment(UIOffset(horizontal: -(YDSSearchBar.rightMargin - YDSSearchBar.clearButtonDefaultRightMargin), vertical: 0), for: .clear) - - self.snp.makeConstraints { - $0.height.equalTo(YDSSearchBar.searchBarHeight) - } setState() } diff --git a/YDS/Source/Atom/YDSTextField/YDSPasswordTextField/YDSPasswordTextField.swift b/YDS/Source/Atom/YDSTextField/YDSPasswordTextField/YDSPasswordTextField.swift index 99ddc3af..3d28a1f3 100644 --- a/YDS/Source/Atom/YDSTextField/YDSPasswordTextField/YDSPasswordTextField.swift +++ b/YDS/Source/Atom/YDSTextField/YDSPasswordTextField/YDSPasswordTextField.swift @@ -61,10 +61,9 @@ public class YDSPasswordTextField: UITextField { // MARK: - 뷰 - private let maskingButton: UIButton = { - // 이 부분은 향후 YDSPlainButton으로 교체 예정 - let button = UIButton(frame: CGRect(x: 0, y: 0, width: 20, height: 20)) - button.adjustsImageWhenHighlighted = false + private let maskingButton: YDSPlainButton = { + let button = YDSPlainButton() + button.size = .medium return button }()