diff --git a/Drink-EG/Drink-EG/Resources/SceneDelegate.swift b/Drink-EG/Drink-EG/Resources/SceneDelegate.swift index 4abab0b..dbe1d33 100644 --- a/Drink-EG/Drink-EG/Resources/SceneDelegate.swift +++ b/Drink-EG/Drink-EG/Resources/SceneDelegate.swift @@ -20,7 +20,7 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // 화면을 구성하는 UIWindow 인스턴스 생성 let window = UIWindow(windowScene: windowScene) // 실제 첫 화면이 되는 MainViewController 인스턴스 생성 - let vc = ChooseTasteViewController() + let vc = EnterLoginViewController() // NavigationController을 사용할 경우, MainViewController를 rootViewController로 갖는 NavigationController을 생성해야한다. let navigationController = UINavigationController(rootViewController: vc) navigationController.isNavigationBarHidden = true diff --git a/Drink-EG/Drink-EG/Sources/VCs/Community/CommunityMainViewController.swift b/Drink-EG/Drink-EG/Sources/VCs/Community/CommunityMainViewController.swift index 54f1183..e1462e8 100644 --- a/Drink-EG/Drink-EG/Sources/VCs/Community/CommunityMainViewController.swift +++ b/Drink-EG/Drink-EG/Sources/VCs/Community/CommunityMainViewController.swift @@ -17,13 +17,13 @@ class CommunityMainViewController : UIViewController, UITableViewDataSource, UIT let newCreate = UILabel() var communityLowerCollectionViews: [CustomCollectionViewCell] = [] var suggestion: [String] = [] - var allSuggestion: [String] = ["Apple", "Banana", "Grape", "Orange", "Watermelon", "Strawberry"] + var allSuggestion: [String] = [""] private let items = [ - ["title": "금요일 밤 와인모임", "subtitle": "뚝섬역에서 가볍게 함께 즐겨요!", "detail": "7/10 | 서울특별시, 용산구 | 25,000원", "imageName": "SampleImage"], - ["title": "목요일 밤 와인모임", "subtitle": "뚝섬역에서 가볍게 함께 즐겨요!", "detail": "6/10 | 서울특별시, 용산구 | 25,000원", "imageName": "SampleImage"], - ["title": "수요일 밤 와인모임", "subtitle": "뚝섬역에서 가볍게 함께 즐겨요!", "detail": "5/10 | 서울특별시, 용산구 | 25,000원", "imageName": "SampleImage"], - ["title": "화요일 밤 와인모임", "subtitle": "뚝섬역에서 가볍게 함께 즐겨요!", "detail": "4/10 | 서울특별시, 용산구 | 25,000원", "imageName": "SampleImage"], + ["title": "금요일 밤 와인모임", "subtitle": "강남역에서 가볍게 함께 즐겨요!", "detail": "7/10 | 서울특별시, 서초구 | 27,000원", "imageName": "Red Label"], + ["title": "목요일 밤 와인모임", "subtitle": "뚝섬역에서 가볍게 함께 즐겨요!", "detail": "6/10 | 서울특별시, 용산구 | 25,000원", "imageName": "ClassSampleImage"], + ["title": "수요일 밤 와인모임", "subtitle": "양재역에서 가볍게 함께 즐겨요!", "detail": "9/10 | 서울특별시, 서초구 | 20,000원", "imageName": "Loxton"], + ["title": "화요일 밤 와인모임", "subtitle": "용산역에서 가볍게 함께 즐겨요!", "detail": "3/10 | 서울특별시, 용산구 | 25,000원", "imageName": "Samos"], ] lazy var communitySearchBar: UISearchBar = { @@ -259,10 +259,13 @@ class CommunityMainViewController : UIViewController, UITableViewDataSource, UIT let collectionView = CustomCollectionViewCell(frame: .zero) collectionView.backgroundColor = UIColor(hex: "E5E5E5") collectionView.configure(title: item["title"]!, subtitle: item["subtitle"]! , detail: item["detail"]!, imageName: item["imageName"]!) + + // 여기에 추가된 코드 collectionView.layer.cornerRadius = 10 collectionView.layer.masksToBounds = true collectionView.contentView.layer.cornerRadius = 10 collectionView.contentView.layer.masksToBounds = true + collectionView.snp.makeConstraints { make in make.height.equalTo(109) } @@ -276,25 +279,12 @@ class CommunityMainViewController : UIViewController, UITableViewDataSource, UIT @objc func lowerCollectionCellTapped(_ sender: UITapGestureRecognizer) { guard let tappedCell = sender.view as? CustomCollectionViewCell else { return } - - // 탭된 셀의 초기 프레임을 저장 - let initialFrame = tappedCell.frame - // 셀을 상단으로 이동시키는 애니메이션. 여기 왜 안 되지... - UIView.animate(withDuration: 0.5, animations: { - tappedCell.frame.origin.y = self.view.safeAreaInsets.top - }) { _ in - // 애니메이션 후, 모달 뷰 - let modalVC = ModalViewController() - modalVC.modalPresentationStyle = .pageSheet - modalVC.modalTransitionStyle = .coverVertical - self.present(modalVC, animated: true) { - // 다시 셀의 위치를 원래대로 되돌림 - UIView.animate(withDuration: 0.5) { - tappedCell.frame = initialFrame - } - } - } + // 바로 모달 뷰를 프레젠트 + let modalVC = ModalViewController() + modalVC.modalPresentationStyle = .pageSheet + modalVC.modalTransitionStyle = .coverVertical + self.present(modalVC, animated: true, completion: nil) } @@ -318,27 +308,11 @@ class CommunityMainViewController : UIViewController, UITableViewDataSource, UIT } func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { - guard let cell = collectionView.cellForItem(at: indexPath) as? CustomCollectionViewCell else { return } - - // 셀의 초기 위치를 저장 - let initialFrame = cell.frame - - // 셀을 상단으로 이동하는 애니메이션 이것도 안 돼.. - UIView.animate(withDuration: 0.5, animations: { - cell.frame.origin.y = self.view.safeAreaInsets.top - }) { _ in - // 모달 뷰를 프레젠트 - let modalVC = ModalViewController() - modalVC.modalPresentationStyle = .pageSheet - modalVC.modalTransitionStyle = .coverVertical - self.present(modalVC, animated: true) { - // 다시 셀을 원래 위치 - UIView.animate(withDuration: 0.5) { - cell.frame = initialFrame - collectionView.layoutIfNeeded() - } - } - } + // 모달 뷰 + let modalVC = ModalViewController() + modalVC.modalPresentationStyle = .pageSheet + modalVC.modalTransitionStyle = .coverVertical + self.present(modalVC, animated: true, completion: nil) } func setupPageControlConstraints() { diff --git a/Drink-EG/Drink-EG/Sources/VCs/TastingNote/CheckNoteViewController.swift b/Drink-EG/Drink-EG/Sources/VCs/TastingNote/CheckNoteViewController.swift index 57a3feb..add1e71 100644 --- a/Drink-EG/Drink-EG/Sources/VCs/TastingNote/CheckNoteViewController.swift +++ b/Drink-EG/Drink-EG/Sources/VCs/TastingNote/CheckNoteViewController.swift @@ -47,7 +47,7 @@ class CheckNoteViewController: UIViewController { contentView.snp.makeConstraints { make in make.edges.equalTo(scrollView) make.width.equalTo(scrollView) - make.height.equalTo(UIScreen.main.bounds.height * 1.3) + make.height.equalTo(UIScreen.main.bounds.height * 1.1) } }