Skip to content

Commit

Permalink
#171: 검색입력창 컴포넌트 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
dev-muuu committed Feb 12, 2023
1 parent b4d224a commit 69e57df
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions Zatch/Global/Source/Component/SearchTextFieldView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
//
// SearchTextFieldView.swift
// Zatch
//
// Created by 박소윤 on 2023/02/12.
//

import Foundation

extension ZatchComponent{

class SearchTextFieldView: BaseView{

private let textField = UITextField().then{
$0.font = UIFont.pretendard(size: 18, family: .Bold)
$0.textAlignment = .center
}
private let searchIcon = UIImageView().then{
$0.image = Image.search
}
private let borderLine = ZatchComponent.BorderLine(color: .black85, height: 2)

override func hierarchy() {
self.addSubview(textField)
self.addSubview(searchIcon)
self.addSubview(borderLine)
}

override func layout() {
borderLine.snp.makeConstraints{
$0.leading.equalToSuperview().offset(40)
$0.trailing.equalToSuperview().offset(-40)
$0.bottom.equalToSuperview().offset(-16)
}
searchIcon.snp.makeConstraints{
$0.width.height.equalTo(28)
$0.top.equalToSuperview().offset(12)
$0.trailing.equalToSuperview().offset(-48)
$0.bottom.equalToSuperview().offset(-24)
}
textField.snp.makeConstraints{
$0.bottom.equalTo(borderLine.snp.top).offset(-10)
$0.trailing.equalTo(searchIcon.snp.leading).offset(-10)
$0.centerX.equalToSuperview()
}
}
}
}

0 comments on commit 69e57df

Please sign in to comment.