Skip to content

Commit

Permalink
feat: ✨people 화면 골격 생성(#42)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lia316 committed Jun 2, 2021
1 parent 5694422 commit bd9f46b
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 7 deletions.
12 changes: 12 additions & 0 deletions iOS/Airbnb/Airbnb.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
AEC52F742664041200D8F802 /* ConditionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEC52F732664041200D8F802 /* ConditionViewModel.swift */; };
AEF03BA526674E8200050531 /* PriceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEF03BA426674E8200050531 /* PriceViewController.swift */; };
AEF03BA726675AB200050531 /* PriceUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEF03BA626675AB200050531 /* PriceUseCase.swift */; };
AEF03BA92667649000050531 /* PeopleViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = AEF03BA82667649000050531 /* PeopleViewController.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -97,6 +98,7 @@
AEC52F732664041200D8F802 /* ConditionViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConditionViewModel.swift; sourceTree = "<group>"; };
AEF03BA426674E8200050531 /* PriceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PriceViewController.swift; sourceTree = "<group>"; };
AEF03BA626675AB200050531 /* PriceUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PriceUseCase.swift; sourceTree = "<group>"; };
AEF03BA82667649000050531 /* PeopleViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PeopleViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -245,6 +247,7 @@
AEC52F6C2663FDEB00D8F802 /* Condition */,
AEC52F6A2663F28100D8F802 /* Calendar */,
AEF03BA326674E6000050531 /* Price */,
AEF03BAA2667678E00050531 /* People */,
);
path = ConditionPage;
sourceTree = "<group>";
Expand Down Expand Up @@ -280,6 +283,14 @@
path = Price;
sourceTree = "<group>";
};
AEF03BAA2667678E00050531 /* People */ = {
isa = PBXGroup;
children = (
AEF03BA82667649000050531 /* PeopleViewController.swift */,
);
path = People;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -413,6 +424,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
AEF03BA92667649000050531 /* PeopleViewController.swift in Sources */,
AE9AC6A7265CCCBF0038C198 /* CalendarViewController.swift in Sources */,
AEF03BA726675AB200050531 /* PriceUseCase.swift in Sources */,
AE11F5AE265F3D920034779F /* Date+extension.swift in Sources */,
Expand Down
Binary file not shown.
89 changes: 89 additions & 0 deletions iOS/Airbnb/Airbnb/ConditionPage/People/PeopleViewController.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
//
// PeopleViewController.swift
// Airbnb
//
// Created by Lia on 2021/06/02.
//

import UIKit

class PeopleViewController : UIViewController {

private var conditionViewModel: ConditionViewModel
private var priceUseCase = PriceUseCase()
private var containerView: UIView!
let label = UILabel()

init(conditionViewModel: ConditionViewModel) {
self.conditionViewModel = conditionViewModel
super.init(nibName: nil, bundle: nil)
}

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

override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
configureContainer()
configureNavigation()
configureToolBar()
}


}

extension PeopleViewController {
private func configureContainer() {
containerView = UIView()
containerView.translatesAutoresizingMaskIntoConstraints = false
view.addSubview(containerView)

NSLayoutConstraint.activate([
containerView.leadingAnchor.constraint(equalTo: view.leadingAnchor, constant: 0),
containerView.topAnchor.constraint(equalTo: view.bottomAnchor, constant: -250),
containerView.bottomAnchor.constraint(equalTo: view.bottomAnchor, constant: 0),
containerView.trailingAnchor.constraint(equalTo: view.trailingAnchor, constant: 0)
])
containerView.backgroundColor = .cyan
let vc = ConditionTableViewController(viewModel: conditionViewModel)
self.addChild(vc)
containerView.addSubview(vc.view)
}
}


extension PeopleViewController {

private func configureToolBar() {
self.tabBarController?.tabBar.isHidden = true
let toolbar = UIToolbar()
view.addSubview(toolbar)

toolbar.translatesAutoresizingMaskIntoConstraints = false

NSLayoutConstraint.activate([
toolbar.leadingAnchor.constraint(equalToSystemSpacingAfter: view.safeAreaLayoutGuide.leadingAnchor, multiplier: 0),
toolbar.bottomAnchor.constraint(equalToSystemSpacingBelow: view.safeAreaLayoutGuide.bottomAnchor, multiplier: 0),
toolbar.trailingAnchor.constraint(equalToSystemSpacingAfter: view.safeAreaLayoutGuide.trailingAnchor, multiplier: 0)
])

let flexibleSpace = UIBarButtonItem(barButtonSystemItem: .flexibleSpace, target: self, action: nil)
let toolbarItem1 = UIBarButtonItem(title: "건너뛰기", style: .plain, target: self, action: nil)
let toolbarItem2 = UIBarButtonItem(title: "다음", style: .done, target: self, action: nil)

let items = [toolbarItem1, flexibleSpace, toolbarItem2]
items.forEach{ $0.tintColor = .black }

toolbar.setItems(items, animated: true)
}

private func configureNavigation() {
self.navigationItem.title = "숙소 찾기"
let backButton = UIBarButtonItem()
backButton.title = "Back"
self.navigationController?.navigationBar.topItem?.backBarButtonItem = backButton
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -135,15 +135,9 @@ extension PriceViewController {
}

@objc func nextButtonPressed() {
let nextVC = PeopleViewController()//PriceViewController(conditionViewModel: conditionViewModel)
let nextVC = PeopleViewController(conditionViewModel: conditionViewModel)
self.navigationController?.pushViewController(nextVC, animated: true)
}

}

class PeopleViewController : UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = .white
}
}

0 comments on commit bd9f46b

Please sign in to comment.