-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#55] TextField 관련 코드 정리 및 샘플 페이지 정리
- Loading branch information
Showing
15 changed files
with
425 additions
and
360 deletions.
There are no files selected for viewing
74 changes: 0 additions & 74 deletions
74
YDS-Storybook/AtomSampleViewController/PasswordTextFieldSampleViewController.swift
This file was deleted.
Oops, something went wrong.
87 changes: 87 additions & 0 deletions
87
YDS-Storybook/AtomSampleViewController/PasswordTextFieldViewPageViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<UITouch>, with event: UIEvent?) { | ||
sampleTextFieldView.textField.endEditing(true) | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
YDS-Storybook/AtomSampleViewController/SearchBarPageViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<UITouch>, with event: UIEvent?) { | ||
sampleSearchBar.endEditing(true) | ||
} | ||
} |
56 changes: 0 additions & 56 deletions
56
YDS-Storybook/AtomSampleViewController/SearchBarSampleViewController.swift
This file was deleted.
Oops, something went wrong.
67 changes: 67 additions & 0 deletions
67
YDS-Storybook/AtomSampleViewController/SearchTextFieldPageViewController.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<UITouch>, with event: UIEvent?) { | ||
sampleTextField.endEditing(true) | ||
} | ||
} |
56 changes: 0 additions & 56 deletions
56
YDS-Storybook/AtomSampleViewController/SearchTextFieldSampleViewController.swift
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.