Skip to content

Commit

Permalink
[#20] Invalidating didset으로 변경 + public 클래스로 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
hye0njuoo committed Jan 8, 2025
1 parent dae286d commit 4f1d325
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ final class HandySearchBarViewController: BaseViewController {
return uiSearchBar
}()


override func viewDidLoad() {
super.viewDidLoad()

Expand All @@ -45,7 +44,6 @@ final class HandySearchBarViewController: BaseViewController {
self.view.addSubview(searchBar2)
self.view.addSubview(searchBar3)
self.view.addSubview(searchBar4)

}

override func setViewLayouts() {
Expand Down Expand Up @@ -73,7 +71,7 @@ final class HandySearchBarViewController: BaseViewController {

// searchBar2
searchBar2.leftButton.addTarget(self, action: #selector(leftButtonTapped(_:)), for: .touchUpInside)

// searchBar3
searchBar3.rightButton.addTarget(self, action: #selector(rightButtonTapped(_:)), for: .touchUpInside)
}
Expand Down
8 changes: 4 additions & 4 deletions Handy/Handy/Source/Atom/HandySearchBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
import UIKit
import SnapKit

final public class HandySearchBar: UIView {
public class HandySearchBar: UIView {

// MARK: - 외부에서 설정할 수 있는 속성

/**
왼쪽 버튼의 활성화 여부를 설정합니다.
*/
@Invalidating(wrappedValue: true, .layout) public var leftIcon: Bool {
public var leftIcon: Bool = true {
didSet {
leftButton.isHidden = !leftIcon
}
Expand All @@ -24,7 +24,7 @@ final public class HandySearchBar: UIView {
/**
오른쪽 버튼의 활성화 여부를 설정합니다.
*/
@Invalidating(wrappedValue: true, .layout) public var rightIcon: Bool {
public var rightIcon: Bool = true {
didSet {
rightButton.isHidden = !rightIcon
}
Expand All @@ -33,7 +33,7 @@ final public class HandySearchBar: UIView {
/**
텍스트 필드의 플레이스홀더를 설정합니다.
*/
@Invalidating(wrappedValue: "", .layout) public var placeholder: String {
public var placeholder: String = "" {
didSet {
textField.placeholder = placeholder
}
Expand Down

0 comments on commit 4f1d325

Please sign in to comment.