Skip to content

Commit

Permalink
✨ Feat: #18 - 간단한 네비게이션바~
Browse files Browse the repository at this point in the history
  • Loading branch information
usa4060 committed Oct 27, 2023
1 parent 714326e commit 76280b9
Showing 1 changed file with 80 additions and 0 deletions.
80 changes: 80 additions & 0 deletions DesignSystem/Sources/CMCNavigationBar.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
//
// CMCNavigationBar.swift
// DesignSystem
//
// Created by Siri on 10/27/23.
// Copyright © 2023 com.centralMakeusChallenge. All rights reserved.
//

import Foundation

import RxCocoa
import RxGesture
import RxSwift

import SnapKit

import UIKit


public final class CMCNavigationBar: UIView {

// MARK: - UI
public lazy var backButton: CMCTouchArea = {
let backButton = CMCTouchArea(
image: DesignSystemAsset._24x24arrowLeft.image
)
return backButton
}()

public lazy var accessoryLabel: UILabel = {
let label = UILabel()
label.font = DesignSystemFontFamily.Pretendard.bold.font(size: 14)
label.textColor = DesignSystemAsset.gray700.color
return label
}()

// MARK: - Properties
private var accessoryLabelHidden: Bool

// MARK: - Initializers
init(accessoryLabelHidden: Bool) {
self.accessoryLabelHidden = accessoryLabelHidden

super.init(frame: .zero)

self.backgroundColor = DesignSystemAsset.background.color

self.addSubviews()
self.addConstraints()
self.addUIConfigure()
}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

// MARK: - Methods

private func addSubviews() {
self.addSubview(backButton)
self.addSubview(accessoryLabel)
}

private func addConstraints() {
backButton.snp.makeConstraints {
$0.leading.equalToSuperview().offset(5)
$0.centerY.equalToSuperview()
$0.width.height.equalTo(44)
}

accessoryLabel.snp.makeConstraints {
$0.trailing.equalToSuperview().offset(-24)
$0.centerY.equalToSuperview()
}
}

private func addUIConfigure() {
accessoryLabel.isHidden = accessoryLabelHidden
}
}

0 comments on commit 76280b9

Please sign in to comment.