Skip to content

Commit

Permalink
[FEAT][#59] 세션 등록 중 장소등록 GUI 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
dayo2n committed Feb 22, 2023
1 parent 9425576 commit 40dadec
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 16 deletions.
4 changes: 2 additions & 2 deletions momoIOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
BF04086D2987E38C00F1129B /* RegistrationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF04086C2987E38C00F1129B /* RegistrationController.swift */; };
BF04086F2987E70200F1129B /* CheckSecurityCodeController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF04086E2987E70200F1129B /* CheckSecurityCodeController.swift */; };
BF088BC5299A10B100A63A5B /* AbsenceModalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF088BC4299A10B100A63A5B /* AbsenceModalViewController.swift */; };
BF234F60299B597300E6ADBA /* RegisterPlaceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF234F5F299B597300E6ADBA /* RegisterPlaceViewController.swift */; };
BF088BC8299A12FA00A63A5B /* InputMoimYearViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF088BC7299A12FA00A63A5B /* InputMoimYearViewController.swift */; };
BF088BCA299A188900A63A5B /* InputSecurityCodeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF088BC9299A188900A63A5B /* InputSecurityCodeViewController.swift */; };
BF234F60299B597300E6ADBA /* RegisterPlaceViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF234F5F299B597300E6ADBA /* RegisterPlaceViewController.swift */; };
BF405C7829972C4900B5889D /* AddIndividualMemberViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF405C7729972C4900B5889D /* AddIndividualMemberViewController.swift */; };
BF405C7E29976DB400B5889D /* CommonTitleLabel.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF405C7D29976DB400B5889D /* CommonTitleLabel.swift */; };
BF405C8029976F9300B5889D /* CommonTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = BF405C7F29976F9300B5889D /* CommonTextField.swift */; };
Expand Down Expand Up @@ -81,9 +81,9 @@
BF04086C2987E38C00F1129B /* RegistrationController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegistrationController.swift; sourceTree = "<group>"; };
BF04086E2987E70200F1129B /* CheckSecurityCodeController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CheckSecurityCodeController.swift; sourceTree = "<group>"; };
BF088BC4299A10B100A63A5B /* AbsenceModalViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AbsenceModalViewController.swift; sourceTree = "<group>"; };
BF234F5F299B597300E6ADBA /* RegisterPlaceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterPlaceViewController.swift; sourceTree = "<group>"; };
BF088BC7299A12FA00A63A5B /* InputMoimYearViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InputMoimYearViewController.swift; sourceTree = "<group>"; };
BF088BC9299A188900A63A5B /* InputSecurityCodeViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InputSecurityCodeViewController.swift; sourceTree = "<group>"; };
BF234F5F299B597300E6ADBA /* RegisterPlaceViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RegisterPlaceViewController.swift; sourceTree = "<group>"; };
BF405C7729972C4900B5889D /* AddIndividualMemberViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AddIndividualMemberViewController.swift; sourceTree = "<group>"; };
BF405C7D29976DB400B5889D /* CommonTitleLabel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonTitleLabel.swift; sourceTree = "<group>"; };
BF405C7F29976F9300B5889D /* CommonTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommonTextField.swift; sourceTree = "<group>"; };
Expand Down
39 changes: 25 additions & 14 deletions momoIOS/AdminSide/AdminSession/RegisterPlaceViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class RegisterPlaceViewController: UIViewController {
private let searchGuideLabel: UILabel = {
let label = UILabel()
label.text = "도로명이나 지역명을 이용해서 검색해보세요.\n건물번호, 번지를 입력하시면 정확하게 검색됩니다."
label.font = .systemFont(ofSize: 16, weight: .light)
label.font = .systemFont(ofSize: 16, weight: .medium)
label.textColor = .rgba(138, 138, 138, 1)
label.numberOfLines = 0
return label
Expand Down Expand Up @@ -50,33 +50,44 @@ class RegisterPlaceViewController: UIViewController {
// MARK: - Helpers

private func setupCustomNav() {
let appearance = UINavigationBarAppearance()
appearance.shadowColor = .rgba(24, 24, 24, 0.16)
appearance.backgroundColor = .white

let navBar = self.navigationController?.navigationBar
navBar?.scrollEdgeAppearance = appearance
navBar?.tintColor = .black

self.navigationItem.hidesBackButton = true
navigationItem.leftBarButtonItem = UIBarButtonItem(image: UIImage(systemName: "arrow.left"), style: .plain, target: self, action: #selector(goBackToAddSessionVC))

let title = UILabel()
title.text = "장소등록"
title.font = .systemFont(ofSize: 16, weight: .semibold)
title.font = .systemFont(ofSize: 16)
self.navigationItem.titleView = title
}

private func setupSearchArea() {
searchBar.delegate = self
searchBar.placeholder = "검색"
searchBar.setImage(UIImage(), for: .search, state: .normal)
searchBar.searchTextField.backgroundColor = .clear

/// searchBar의 배경색 지정
searchBar.backgroundColor = .rgba(248, 248, 249, 1)

/// default border를 없애고 searchBar 내 textField 배경색 지정
searchBar.searchTextField.borderStyle = .none
searchBar.searchTextField.backgroundColor = .rgba(248, 248, 249, 1)
searchBar.searchBarStyle = .minimal

/// placeholder와 text 속성 설정
searchBar.searchTextField.font = .systemFont(ofSize: 14, weight: .medium)
searchBar.searchTextField.textColor = .black
searchBar.searchTextField.attributedPlaceholder = NSAttributedString(
string: "검색",
attributes: [NSAttributedString.Key.foregroundColor: UIColor.rgba(179, 182, 197, 1),
NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14, weight: .medium)])
// TODO: - placeholder의 foregroundColor는 GUI의 gray500, 추후 extension에 추가되면 수정

/// 이외 속성들 설정
searchBar.setImage(UIImage(), for: .search, state: .normal)
searchBar.searchTextField.clearButtonMode = .never
searchBar.layer.borderWidth = 1
searchBar.layer.cornerRadius = 8
searchBar.layer.borderColor = UIColor.rgba(230, 230, 230, 1).cgColor
searchBar.layer.borderColor = UIColor.clear.cgColor

view.addSubviews(searchBar, searchIcon)
searchIcon.image = searchIcon.image?.withRenderingMode(.alwaysTemplate)
Expand Down Expand Up @@ -153,16 +164,16 @@ extension RegisterPlaceViewController: GMSAutocompleteTableDataSourceDelegate {

func tableDataSource(_ tableDataSource: GMSAutocompleteTableDataSource, didAutocompleteWith place: GMSPlace) {
// Do something with the selected place.
print("\(place)")

print("\(place.formattedAddress)")
for sub in self.view.subviews {
if let subview = sub as? UITableView {
subview.removeFromSuperview()
break
}
}
self.searchBar.endEditing(true)
self.searchBar.text = ""
self.searchBar.text = "" /// Notes: 장소를 선택한 후 UISearchBar의 text를 비워주지 않으면 placeholder가 검색어로 바뀜.
}

func tableDataSource(_ tableDataSource: GMSAutocompleteTableDataSource, didFailAutocompleteWithError error: Error) {
Expand Down

0 comments on commit 40dadec

Please sign in to comment.