Skip to content

Commit

Permalink
[#55] 코드 스타일 통일
Browse files Browse the repository at this point in the history
  • Loading branch information
Gyuni committed Aug 22, 2021
1 parent b01df50 commit 6fe69d3
Show file tree
Hide file tree
Showing 18 changed files with 69 additions and 161 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class BadgePageViewController: StoryBookViewController {

addOption(description: "color",
cases: YDSItemColor.allCases,
defaultIndex: 3) { [weak self] value in
defaultIndex: 6) { [weak self] value in
self?.sampleBadge.color = value
}

Expand Down
5 changes: 2 additions & 3 deletions YDS-Storybook/PageListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ class PageListViewController: UIViewController {

view.addSubview(pageListTableView)
pageListTableView.snp.makeConstraints {
$0.top.equalTo(view.safeAreaLayoutGuide.snp.top)
$0.bottom.equalTo(view.safeAreaLayoutGuide.snp.bottom)
$0.leading.trailing.equalToSuperview()
$0.top.leading.trailing.equalTo(view.safeAreaLayoutGuide)
$0.bottom.equalToSuperview()
}

self.navigationItem.setRightBarButtonItems(
Expand Down
2 changes: 1 addition & 1 deletion YDS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = 86886QH957;
DEVELOPMENT_TEAM = 2N3PMJ78CA;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down
12 changes: 3 additions & 9 deletions YDS/Source/Atom/YDSBadge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,17 @@ public class YDSBadge: UIView {

/// 뱃지의 글귀를 설정할 때 사용합니다.
public var text: String? = nil {
didSet {
setText()
}
didSet { setText() }
}

/// 뱃지에 들어갈 아이콘 이미지를 설정할 때 사용합니다.
public var icon: UIImage? = nil {
didSet {
setIcon()
}
didSet { setIcon() }
}

/// 뱃지의 색상을 설정할 때 사용합니다.
public var color: YDSItemColor = .mono {
didSet {
setColor()
}
didSet { setColor() }
}

// MARK: - 내부에서 사용되는 상수
Expand Down
12 changes: 3 additions & 9 deletions YDS/Source/Atom/YDSLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ import UIKit

public class YDSLabel: UILabel {
public var style : String.TypoStyle {
didSet {
setAttributedText()
}
didSet { setAttributedText() }
}

public init(style: String.TypoStyle) {
Expand All @@ -24,15 +22,11 @@ public class YDSLabel: UILabel {
}

public override var text: String? {
didSet {
setAttributedText()
}
didSet { setAttributedText() }
}

public override var textColor: UIColor! {
didSet {
setAttributedText()
}
didSet { setAttributedText() }
}

private func setAttributedText() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ public class YDSPasswordTextField: UITextField {

/// maskingButton의 너비입니다.
private var maskingButtonWidth: CGFloat {
get {
return rightViewRect(forBounds: bounds).width
}
get { return rightViewRect(forBounds: bounds).width }
}

/// masking 상태가 on임을 나타내는 아이콘입니다.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,37 +49,24 @@ public class YDSPasswordTextFieldView: UIView {

/// 필드에 입력된 텍스트입니다.
public var text: String? {
get {
return textField.text
}

set(inputValue) {
textField.text = inputValue
}
get { return textField.text }
set { textField.text = newValue }
}

/// 필드에 나타나는 placeholder의 텍스트입니다.
public var placeholder: String? {
get {
return textField.placeholder
}

set(inputValue) {
textField.placeholder = inputValue
}
get { return textField.placeholder }
set { textField.placeholder = newValue }
}

/// 필드 위쪽에 나타나는 fieldLabel의 텍스트입니다.
/// nil이 들어오면 fieldLabel이 사라집니다.
public var fieldLabelText: String? {
get {
return fieldLabel.text
}

set(inputValue) {
fieldLabel.text = inputValue
get { return fieldLabel.text }
set {
fieldLabel.text = newValue

if inputValue == nil {
if newValue == nil {
fieldLabel.isHidden = true
} else {
fieldLabel.isHidden = false
Expand All @@ -90,14 +77,11 @@ public class YDSPasswordTextFieldView: UIView {
/// 필드 아래쪽에 나타나는 helperLabel의 텍스트입니다.
/// nil이 들어오면 helperLabel이 사라집니다.
public var helperLabelText: String? {
get {
return helperLabel.text
}

set(inputValue) {
helperLabel.text = inputValue
get { return helperLabel.text }
set {
helperLabel.text = newValue

if inputValue == nil {
if newValue == nil {
helperLabel.isHidden = true
} else {
helperLabel.isHidden = false
Expand Down
8 changes: 2 additions & 6 deletions YDS/Source/Atom/YDSTextField/YDSSearchTextField.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,12 @@ public class YDSSearchTextField: UITextField {

/// searchIcon의 너비입니다.
private var searchIconWidth: CGFloat {
get {
return searchIcon.frame.width
}
get { return searchIcon.frame.width }
}

/// clearButton의 너비입니다.
private var clearButtonWidth: CGFloat {
get {
return clearButtonRect(forBounds: bounds).width
}
get { return clearButtonRect(forBounds: bounds).width }
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,7 @@ public class YDSSimpleTextField: UITextField {

/// clearButton의 너비입니다.
private var clearButtonWidth: CGFloat {
get {
return clearButtonRect(forBounds: bounds).width
}
get { return clearButtonRect(forBounds: bounds).width }
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,37 +40,25 @@ public class YDSSimpleTextFieldView: UIView {

/// 필드에 입력된 텍스트입니다.
public var text: String? {
get {
return textField.text
}

set(inputValue) {
textField.text = inputValue
}
get { return textField.text }
set { textField.text = newValue }
}

/// 필드에 나타나는 placeholder의 텍스트입니다.
public var placeholder: String? {
get {
return textField.placeholder
}

set(inputValue) {
textField.placeholder = inputValue
}
get { return textField.placeholder }
set { textField.placeholder = newValue }
}

/// 필드 위쪽에 나타나는 fieldLabel의 텍스트입니다.
/// nil이 들어오면 fieldLabel이 사라집니다.
public var fieldLabelText: String? {
get {
return fieldLabel.text
}
get { return fieldLabel.text }

set(inputValue) {
fieldLabel.text = inputValue
set {
fieldLabel.text = newValue

if inputValue == nil {
if newValue == nil {
fieldLabel.isHidden = true
} else {
fieldLabel.isHidden = false
Expand All @@ -81,14 +69,11 @@ public class YDSSimpleTextFieldView: UIView {
/// 필드 아래쪽에 나타나는 helperLabel의 텍스트입니다.
/// nil이 들어오면 helperLabel이 사라집니다.
public var helperLabelText: String? {
get {
return helperLabel.text
}

set(inputValue) {
helperLabel.text = inputValue
get { return helperLabel.text }
set {
helperLabel.text = newValue

if inputValue == nil {
if newValue == nil {
helperLabel.isHidden = true
} else {
helperLabel.isHidden = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,11 @@ public class YDSSuffixTextField: UITextField {

/// 필드 우측에 나타나는 suffixLabel의 텍스트입니다.
internal var suffixLabelText: String? {
get {
return suffixLabel.text
}

set(inputValue) {
suffixLabel.text = inputValue
get { return suffixLabel.text }
set {
suffixLabel.text = newValue

if inputValue == nil {
if newValue == nil {
suffixLabel.isHidden = true
} else {
suffixLabel.isHidden = false
Expand All @@ -61,9 +58,7 @@ public class YDSSuffixTextField: UITextField {

/// suffixLabel의 너비입니다.
private var suffixLabelWidth: CGFloat {
get {
return rightViewRect(forBounds: bounds).width
}
get { return rightViewRect(forBounds: bounds).width }
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,37 +40,24 @@ public class YDSSuffixTextFieldView: UIView {

/// 필드에 입력된 텍스트입니다.
public var text: String? {
get {
return textField.text
}

set(inputValue) {
textField.text = inputValue
}
get { return textField.text }
set { textField.text = newValue }
}

/// 필드에 나타나는 placeholder의 텍스트입니다.
public var placeholder: String? {
get {
return textField.placeholder
}

set(inputValue) {
textField.placeholder = inputValue
}
get { return textField.placeholder }
set { textField.placeholder = newValue }
}

/// 필드 위쪽에 나타나는 fieldLabel의 텍스트입니다.
/// nil이 들어오면 fieldLabel이 사라집니다.
public var fieldLabelText: String? {
get {
return fieldLabel.text
}

set(inputValue) {
fieldLabel.text = inputValue
get { return fieldLabel.text }
set {
fieldLabel.text = newValue

if inputValue == nil {
if newValue == nil {
fieldLabel.isHidden = true
} else {
fieldLabel.isHidden = false
Expand All @@ -81,14 +68,11 @@ public class YDSSuffixTextFieldView: UIView {
/// 필드 아래쪽에 나타나는 helperLabel의 텍스트입니다.
/// nil이 들어오면 helperLabel이 사라집니다.
public var helperLabelText: String? {
get {
return helperLabel.text
}

set(inputValue) {
helperLabel.text = inputValue
get { return helperLabel.text }
set {
helperLabel.text = newValue

if inputValue == nil {
if newValue == nil {
helperLabel.isHidden = true
} else {
helperLabel.isHidden = false
Expand All @@ -98,13 +82,8 @@ public class YDSSuffixTextFieldView: UIView {

/// 필드 우측에 나타나는 suffixLabel의 텍스트입니다.
public var suffixLabelText: String? {
get {
return textField.suffixLabelText
}

set(inputValue) {
textField.suffixLabelText = inputValue
}
get { return textField.suffixLabelText }
set { textField.suffixLabelText = newValue }
}


Expand Down
16 changes: 4 additions & 12 deletions YDS/Source/Component/TopBar/YDSDoubleTitleTopBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,17 @@ public class YDSDoubleTitleTopBar: YDSTopBar {
굵은 Title의 String입니다.
*/
public var title: String? {
get {
return self.titleLabel.text
}
set(inputValue) {
self.titleLabel.text = inputValue
}
get { return self.titleLabel.text }
set { self.titleLabel.text = newValue }
}

/**
NavigationBar 상단에 들어가는
얇은 Title의 String입니다.
*/
public var subtitle: String? {
get {
return self.subtitleLabel.text
}
set(inputValue) {
self.subtitleLabel.text = inputValue
}
get { return self.subtitleLabel.text }
set { self.subtitleLabel.text = newValue }
}


Expand Down
Loading

0 comments on commit 6fe69d3

Please sign in to comment.