Skip to content

Commit

Permalink
Merge branch 'develop' into feature/TeamNADA#91
Browse files Browse the repository at this point in the history
  • Loading branch information
mini-min committed Nov 30, 2021
2 parents a5fb85d + 2694fcb commit a590771
Show file tree
Hide file tree
Showing 11 changed files with 392 additions and 23 deletions.
24 changes: 16 additions & 8 deletions NADA-iOS-forRelease.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
39D88B6B274600B100A72164 /* CommonBottomSheetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39D88B6A274600B100A72164 /* CommonBottomSheetViewController.swift */; };
39F5A3D0271461EA00191F94 /* BackCardCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 39F5A3CE271461EA00191F94 /* BackCardCell.swift */; };
39F5A3D1271461EA00191F94 /* BackCardCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 39F5A3CF271461EA00191F94 /* BackCardCell.xib */; };
7705CF3E2752C7DB005195DF /* CardView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7705CF3D2752C7DB005195DF /* CardView.swift */; };
7705CF402752C844005195DF /* CardView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7705CF3F2752C844005195DF /* CardView.xib */; };
7713E8482752E2A900724C8B /* SelectGroupBottomSheetViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7713E8472752E2A900724C8B /* SelectGroupBottomSheetViewController.swift */; };
7729171F2743D604001593E0 /* CardsInGroupResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7729171E2743D604001593E0 /* CardsInGroupResponse.swift */; };
77607EDA274A68BE00204CD2 /* GroupCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 77607ED8274A68BD00204CD2 /* GroupCollectionViewCell.swift */; };
77607EDB274A68BE00204CD2 /* GroupCollectionViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 77607ED9274A68BD00204CD2 /* GroupCollectionViewCell.xib */; };
Expand Down Expand Up @@ -104,7 +107,6 @@
F8FC439226C01CDE0033E151 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F8FC439026C01CDE0033E151 /* LaunchScreen.storyboard */; };
F8FC43AD26C020940033E151 /* TempClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8FC43AC26C020940033E151 /* TempClass.swift */; };
F8FC43B326C020B90033E151 /* BackCardCreationDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8FC43B226C020B90033E151 /* BackCardCreationDelegate.swift */; };
F8FC43B526C020C10033E151 /* TempViews.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8FC43B426C020C10033E151 /* TempViews.swift */; };
F8FC43B826C0227D0033E151 /* Const.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8FC43B726C0227D0033E151 /* Const.swift */; };
F8FC43BA26C022900033E151 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8FC43B926C022900033E151 /* ViewController.swift */; };
F8FC43BC26C022A20033E151 /* Storyboard.swift in Sources */ = {isa = PBXBuildFile; fileRef = F8FC43BB26C022A20033E151 /* Storyboard.swift */; };
Expand Down Expand Up @@ -157,6 +159,9 @@
39F5A3CE271461EA00191F94 /* BackCardCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackCardCell.swift; sourceTree = "<group>"; };
39F5A3CF271461EA00191F94 /* BackCardCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = BackCardCell.xib; sourceTree = "<group>"; };
4A2183AE0E469153221624A0 /* Pods_NADA_iOS_forRelease.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_NADA_iOS_forRelease.framework; sourceTree = BUILT_PRODUCTS_DIR; };
7705CF3D2752C7DB005195DF /* CardView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardView.swift; sourceTree = "<group>"; };
7705CF3F2752C844005195DF /* CardView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CardView.xib; sourceTree = "<group>"; };
7713E8472752E2A900724C8B /* SelectGroupBottomSheetViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SelectGroupBottomSheetViewController.swift; sourceTree = "<group>"; };
7729171E2743D604001593E0 /* CardsInGroupResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CardsInGroupResponse.swift; sourceTree = "<group>"; };
77607ED8274A68BD00204CD2 /* GroupCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupCollectionViewCell.swift; sourceTree = "<group>"; };
77607ED9274A68BD00204CD2 /* GroupCollectionViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = GroupCollectionViewCell.xib; sourceTree = "<group>"; };
Expand Down Expand Up @@ -213,7 +218,6 @@
F8FC439326C01CDE0033E151 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
F8FC43AC26C020940033E151 /* TempClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TempClass.swift; sourceTree = "<group>"; };
F8FC43B226C020B90033E151 /* BackCardCreationDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackCardCreationDelegate.swift; sourceTree = "<group>"; };
F8FC43B426C020C10033E151 /* TempViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TempViews.swift; sourceTree = "<group>"; };
F8FC43B726C0227D0033E151 /* Const.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Const.swift; sourceTree = "<group>"; };
F8FC43B926C022900033E151 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
F8FC43BB26C022A20033E151 /* Storyboard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Storyboard.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -375,6 +379,7 @@
77DFB870274F92F9000CD36F /* AddWithIdBottomSheetViewController.swift */,
398413B6274A7A1E005550BC /* AddGroupBottomSheetViewController.swift */,
77703156275005AA002CBD19 /* CardResultBottomSheetViewController.swift */,
7713E8472752E2A900724C8B /* SelectGroupBottomSheetViewController.swift */,
);
path = BottomSheet;
sourceTree = "<group>";
Expand Down Expand Up @@ -697,7 +702,8 @@
F8FC43A126C01F1F0033E151 /* Views */ = {
isa = PBXGroup;
children = (
F8FC43B426C020C10033E151 /* TempViews.swift */,
7705CF3D2752C7DB005195DF /* CardView.swift */,
7705CF3F2752C844005195DF /* CardView.xib */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -822,6 +828,7 @@
3936993B274A53C600684420 /* GroupEdit.storyboard in Resources */,
39D88B642745FDD400A72164 /* TabBar.storyboard in Resources */,
7766A410274FEBE200714912 /* CardInGroupCollectionViewCell.xib in Resources */,
7705CF402752C844005195DF /* CardView.xib in Resources */,
39523E5C2701A48900536900 /* CardListTableViewCell.xib in Resources */,
F8FC439226C01CDE0033E151 /* LaunchScreen.storyboard in Resources */,
F8FC438F26C01CDE0033E151 /* Assets.xcassets in Resources */,
Expand Down Expand Up @@ -910,6 +917,7 @@
F8C83FBD272F9F430009DF0D /* GenericResponse.swift in Sources */,
398413B7274A7A1E005550BC /* AddGroupBottomSheetViewController.swift in Sources */,
77DFB871274F92F9000CD36F /* AddWithIdBottomSheetViewController.swift in Sources */,
7713E8482752E2A900724C8B /* SelectGroupBottomSheetViewController.swift in Sources */,
39007F2C27080D8200E7143E /* UIViewController+Extension.swift in Sources */,
F8C83FB6272F9E380009DF0D /* UtilService.swift in Sources */,
3958F239270FFBBF00B100B2 /* GroupViewController.swift in Sources */,
Expand Down Expand Up @@ -940,7 +948,6 @@
F8FC43B326C020B90033E151 /* BackCardCreationDelegate.swift in Sources */,
39584581273E951C009CC6B9 /* MainListRequest.swift in Sources */,
39369944274A568900684420 /* GroupEditTableViewCell.swift in Sources */,
F8FC43B526C020C10033E151 /* TempViews.swift in Sources */,
F8C83FBB272F9F370009DF0D /* NetworkResult.swift in Sources */,
39D2E130270B43DA00AD0889 /* UIFont+Extension.swift in Sources */,
7770315B27500C7B002CBD19 /* QRScanViewController.swift in Sources */,
Expand All @@ -949,6 +956,7 @@
F8A9FE1A2743DC6B00BC60CE /* CardListInGroupRequest.swift in Sources */,
3981148E273BEBB300E28630 /* CardListEditRequest.swift in Sources */,
39D88B6B274600B100A72164 /* CommonBottomSheetViewController.swift in Sources */,
7705CF3E2752C7DB005195DF /* CardView.swift in Sources */,
F8FC43BA26C022900033E151 /* ViewController.swift in Sources */,
39523E5F2701AA9000536900 /* CardListDataModel.swift in Sources */,
39D13568273FDCB800B1A148 /* UserWithTokenRequest.swift in Sources */,
Expand Down Expand Up @@ -1114,13 +1122,13 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 4QG3GC35LA;
DEVELOPMENT_TEAM = T3VFJ764ZC;
INFOPLIST_FILE = "NADA-iOS-forRelease/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "hyun99999.NADA-iOS-forRelease";
PRODUCT_BUNDLE_IDENTIFIER = "YJC.NADA-iOS-forRelease";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand All @@ -1134,13 +1142,13 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 4QG3GC35LA;
DEVELOPMENT_TEAM = T3VFJ764ZC;
INFOPLIST_FILE = "NADA-iOS-forRelease/Info.plist";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "hyun99999.NADA-iOS-forRelease";
PRODUCT_BUNDLE_IDENTIFIER = "YJC.NADA-iOS-forRelease";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down
17 changes: 17 additions & 0 deletions NADA-iOS-forRelease/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,23 @@
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSApplicationCategoryType</key>
<string></string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UIAppFonts</key>
<array>
<string>NotoSansCJKkr-Bold.otf</string>
<string>NotoSansCJKkr-Medium.otf</string>
<string>NotoSansCJKkr-Regular.otf</string>
<string>Spoqa Han Sans Neo Bold.otf</string>
<string>Spoqa Han Sans Neo Regular.otf</string>
</array>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
Expand Down Expand Up @@ -75,5 +90,7 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIUserInterfaceStyle</key>
<string></string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ extension Const {
static let addGroupBottomSheetViewController = "AddGroupBottomSheetViewController"
static let addWithIdBottomSheetViewController = "AddWithIdBottomSheetViewController"
static let cardResultBottomSheetViewController = "CardResultBottomSheetViewController"
static let selectGroupBottomSheetViewController = "SelectGroupBottomSheetViewController"
static let moreViewController = "MoreViewController"
}
}
Expand Down
1 change: 1 addition & 0 deletions NADA-iOS-forRelease/Resouces/Constants/Xib.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ extension Const {
static let cardInGroupCollectionViewCell = "CardInGroupCollectionViewCell"
static let groupEditTableViewCell = "GroupEditTableViewCell"
static let moreListTableViewCell = "MoreListTableViewCell"
static let cardView = "CardView"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ extension AddWithIdBottomSheetViewController {
func textFieldShouldReturn(_ textField: UITextField) -> Bool {
textField.resignFirstResponder()
// 서버 연결과 더불어... 검색 결과가 없으면 bottomsheet dismiss 하지 말고 hidden 풀어주기
hideBottomSheetAndPresent(nextBottomSheet: CardResultBottomSheetViewController())
hideBottomSheetAndPresent(nextBottomSheet: CardResultBottomSheetViewController(), title: "이채연", height: 574)
return true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,72 @@
import UIKit
import IQKeyboardManagerSwift

class CardResultBottomSheetViewController: CommonBottomSheetViewController, UITextFieldDelegate {
class CardResultBottomSheetViewController: CommonBottomSheetViewController {

// MARK: - Properties
private let groupLabel: UILabel = {
let label = UILabel()
label.text = "어쩌구 동아리 명함"
label.textColor = .secondary
label.font = .textRegular03

return label
}()

private let cardView: UIView = {
let view = CardView()
return view
}()

private let addButton: UIButton = {
let button = UIButton()
button.setImage(UIImage(named: "btnMainAdd"), for: .normal)
button.addTarget(self, action: #selector(presentGroupSelectBottomSheet), for: .touchUpInside)

return button
}()

// MARK: - View Life Cycle
override func viewDidLoad() {
super.viewDidLoad()

// Do any additional setup after loading the view.
setupUI()
}

// MARK: - @Functions
// UI 세팅 작업
private func setupUI() {
view.addSubview(groupLabel)
view.addSubview(cardView)
view.addSubview(addButton)
setupLayout()
}

// 레이아웃 세팅
private func setupLayout() {
groupLabel.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
groupLabel.topAnchor.constraint(equalTo: titleLabel.bottomAnchor, constant: 14),
groupLabel.centerXAnchor.constraint(equalTo: bottomSheetView.centerXAnchor)
])

cardView.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
cardView.topAnchor.constraint(equalTo: groupLabel.bottomAnchor, constant: 20),
cardView.centerXAnchor.constraint(equalTo: bottomSheetView.centerXAnchor),
cardView.widthAnchor.constraint(equalToConstant: 201),
cardView.heightAnchor.constraint(equalToConstant: 332)
])

addButton.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
addButton.topAnchor.constraint(equalTo: cardView.bottomAnchor, constant: 30),
addButton.centerXAnchor.constraint(equalTo: bottomSheetView.centerXAnchor)
])
}

@objc func presentGroupSelectBottomSheet() {
hideBottomSheetAndPresent(nextBottomSheet: SelectGroupBottomSheetViewController(), title: "그룹선택", height: 386)
print("next bottomsheet")
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class CommonBottomSheetViewController: UIViewController {
}

// 바텀 시트 사라지고 바로 다시 다음 바텀 시트 올라오는 애니메이션
func hideBottomSheetAndPresent(nextBottomSheet: CommonBottomSheetViewController) {
func hideBottomSheetAndPresent(nextBottomSheet: CommonBottomSheetViewController, title: String, height: CGFloat) {
let safeAreaHeight = view.safeAreaLayoutGuide.layoutFrame.height
let bottomPadding = view.safeAreaInsets.bottom
bottomSheetViewTopConstraint.constant = safeAreaHeight + bottomPadding
Expand All @@ -206,9 +206,9 @@ class CommonBottomSheetViewController: UIViewController {
if self.presentingViewController != nil {
guard let presentingVC = self.presentingViewController else { return }
self.dismiss(animated: false) {
let nextVC = nextBottomSheet.setTitle("이채연").setHeight(574)
let nextVC = nextBottomSheet.setTitle(title).setHeight(height)
nextVC.modalPresentationStyle = .overFullScreen
presentingVC.present(nextVC, animated: true, completion: nil)
presentingVC.present(nextVC, animated: false, completion: nil)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
//
// SelectGroupBottomSheetViewController.swift
// NADA-iOS-forRelease
//
// Created by Yi Joon Choi on 2021/11/28.
//

import UIKit

class SelectGroupBottomSheetViewController: CommonBottomSheetViewController {

// MARK: - Properties
var groupList = ["미분류", "SOPT", "동아리", "인하대학교"]
var selectedGroup = ""

private let groupPicker: UIPickerView = {
let pickerView = UIPickerView()
pickerView.autoresizingMask = .flexibleWidth

return pickerView
}()

private let doneButton: UIButton = {
let button = UIButton()
button.setImage(UIImage(named: "btnMainDone"), for: .normal)
button.addTarget(self, action: #selector(presentCardInfoViewController), for: .touchUpInside)

return button
}()

override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}

// MARK: - @Functions
// UI 세팅 작업
private func setupUI() {
view.addSubview(groupPicker)
view.addSubview(doneButton)
selectedGroup = groupList[0]
groupPicker.delegate = self
groupPicker.dataSource = self
setupLayout()
}

// 레이아웃 세팅
private func setupLayout() {
groupPicker.selectedRow(inComponent: 0)
groupPicker.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
groupPicker.topAnchor.constraint(equalTo: titleLabel.bottomAnchor, constant: 14),
groupPicker.centerXAnchor.constraint(equalTo: bottomSheetView.centerXAnchor)
])

doneButton.translatesAutoresizingMaskIntoConstraints = false
NSLayoutConstraint.activate([
doneButton.topAnchor.constraint(equalTo: groupPicker.bottomAnchor, constant: 0),
doneButton.centerXAnchor.constraint(equalTo: bottomSheetView.centerXAnchor)
])
}

@objc func presentCardInfoViewController() {
print("presentCardInfoViewController")
print(selectedGroup)
}

}

extension SelectGroupBottomSheetViewController: UIPickerViewDelegate, UIPickerViewDataSource {
func numberOfComponents(in pickerView: UIPickerView) -> Int {
return 1
}

func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
return groupList.count
}

func pickerView(_ pickerView: UIPickerView, viewForRow row: Int, forComponent component: Int, reusing view: UIView?) -> UIView {
let label = (view as? UILabel) ?? UILabel()

label.textColor = .quaternary
label.textAlignment = .center
label.font = UIFont(name: "SpoqaHanSansNeo-Regular", size: 16)

if pickerView.selectedRow(inComponent: component) == row {
label.attributedText = NSAttributedString(string: groupList[row], attributes: [NSAttributedString.Key.font: UIFont(name: "SpoqaHanSansNeo-Bold", size: 16.0)!, NSAttributedString.Key.foregroundColor: UIColor.mainColorNadaMain])

} else {
label.attributedText = NSAttributedString(string: groupList[row], attributes: [NSAttributedString.Key.font: UIFont(name: "SpoqaHanSansNeo-Regular", size: 16.0)!, NSAttributedString.Key.foregroundColor: UIColor.quaternary])
}

label.text = groupList[row]

return label
}

func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
print("select=\(groupList[row])")
selectedGroup = groupList[row]
pickerView.reloadAllComponents()
}

func pickerView(_ pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat {
return 44
}

func pickerView(_ pickerView: UIPickerView, widthForComponent component: Int) -> CGFloat {
return 200
}
}
Loading

0 comments on commit a590771

Please sign in to comment.