Skip to content

Commit

Permalink
ADD :: [#332] 네비게이션 바 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
cyj513 committed Jun 3, 2024
1 parent 88e5327 commit 0365eb5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
let useCase = DefaultSelfCareUseCase(repository: SelfCareRepository(networkService: SelfCareService()))
let viewModel = SelfCareHomeViewModel()
let viewController = SelfCareHomeViewController(viewModel)
// let viewModel = SelfCareMyRoutineViewModel(useCase: useCase)
// let viewController = SelfCareMyRoutineViewController(viewModel)
window?.configure(withRootViewController: viewController)
window?.makeKeyAndVisible()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ public class SelfCareTargetMainViewController: BaseViewController<SelfCareTarget
private var headerView = UIView()
private var containerView = UIView()

private let navBar = SelfCareProfileNavigationBar()

private let targetTitleLabel = MGLabel(
font: UIFont.Pretendard.titleLarge,
textColor: .black,
Expand Down Expand Up @@ -93,10 +95,19 @@ public class SelfCareTargetMainViewController: BaseViewController<SelfCareTarget
$0.height.equalTo(20.0)
}

view.addSubviews([targetMainTableView, plusTargetButton])
view.addSubviews([
targetMainTableView,
plusTargetButton,
navBar
])

navBar.snp.makeConstraints {
$0.top.equalTo(view.safeAreaLayoutGuide)
$0.leading.trailing.equalToSuperview()
}
targetMainTableView.tableHeaderView = headerView
targetMainTableView.snp.makeConstraints {
$0.top.equalTo(view.safeAreaLayoutGuide)
$0.top.equalTo(navBar.snp.bottom)
$0.leading.trailing.equalToSuperview()
$0.bottom.equalToSuperview()
}
Expand All @@ -108,6 +119,11 @@ public class SelfCareTargetMainViewController: BaseViewController<SelfCareTarget
}
}
public override func bindActions() {
navBar.leftButtonTap
.bind(onNext: { [weak self] in
self?.navigationController?.popViewController(animated: true)
}).disposed(by: disposeBag)

plusTargetButton.rx.tap
.bind(onNext: { [weak self] in
let useCase = DefaultSelfCareUseCase(repository: SelfCareRepository(networkService: SelfCareService()))
Expand Down

0 comments on commit 0365eb5

Please sign in to comment.