diff --git a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj index 997ebf9e..1640f1d9 100644 --- a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj +++ b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj @@ -96,9 +96,10 @@ DA20D841296696C300F1581F /* MapCollectionViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D840296696C300F1581F /* MapCollectionViewCell.swift */; }; DA20D8432966977D00F1581F /* SearchResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D8422966977D00F1581F /* SearchResultViewController.swift */; }; DA20D8452966979100F1581F /* DiscoveryDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D8442966979100F1581F /* DiscoveryDetailViewController.swift */; }; - DA20D847296697A600F1581F /* PlusDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D846296697A600F1581F /* PlusDetailViewController.swift */; }; + DA20D847296697A600F1581F /* PlusDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D846296697A600F1581F /* PlusDetailVC.swift */; }; DA20D849296697B400F1581F /* UploadViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D848296697B400F1581F /* UploadViewController.swift */; }; DA20D84B296697C600F1581F /* UploadResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D84A296697C600F1581F /* UploadResultViewController.swift */; }; + DA20D84E2966A9B300F1581F /* SearchVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D84D2966A9B300F1581F /* SearchVC.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -204,9 +205,10 @@ DA20D840296696C300F1581F /* MapCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapCollectionViewCell.swift; sourceTree = ""; }; DA20D8422966977D00F1581F /* SearchResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultViewController.swift; sourceTree = ""; }; DA20D8442966979100F1581F /* DiscoveryDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscoveryDetailViewController.swift; sourceTree = ""; }; - DA20D846296697A600F1581F /* PlusDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlusDetailViewController.swift; sourceTree = ""; }; + DA20D846296697A600F1581F /* PlusDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlusDetailVC.swift; sourceTree = ""; }; DA20D848296697B400F1581F /* UploadViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadViewController.swift; sourceTree = ""; }; DA20D84A296697C600F1581F /* UploadResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadResultViewController.swift; sourceTree = ""; }; + DA20D84D2966A9B300F1581F /* SearchVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchVC.swift; sourceTree = ""; }; E837271A78E1C0A0C30789BF /* Pods-Runnect-iOS.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runnect-iOS.release.xcconfig"; path = "Target Support Files/Pods-Runnect-iOS/Pods-Runnect-iOS.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -417,9 +419,10 @@ CEEC6B432961C59F00D00E1E /* .gitkeep */, DA20D8422966977D00F1581F /* SearchResultViewController.swift */, DA20D8442966979100F1581F /* DiscoveryDetailViewController.swift */, - DA20D846296697A600F1581F /* PlusDetailViewController.swift */, + DA20D846296697A600F1581F /* PlusDetailVC.swift */, DA20D848296697B400F1581F /* UploadViewController.swift */, DA20D84A296697C600F1581F /* UploadResultViewController.swift */, + DA20D84D2966A9B300F1581F /* SearchVC.swift */, ); path = Views; sourceTree = ""; @@ -913,7 +916,7 @@ A3BC2F2B2962C3D500198261 /* GoalRewardInfoVC.swift in Sources */, CE665606295D91C500C64E12 /* makeVibrate.swift in Sources */, CE66560A295D924A00C64E12 /* Result+.swift in Sources */, - DA20D847296697A600F1581F /* PlusDetailViewController.swift in Sources */, + DA20D847296697A600F1581F /* PlusDetailVC.swift in Sources */, CE66560E295D92A500C64E12 /* setStatusBarBackgroundColor.swift in Sources */, CE6655D7295D86F900C64E12 /* String+.swift in Sources */, CE58759E29601476005D967E /* LoadingIndicator.swift in Sources */, @@ -945,6 +948,7 @@ CE6655D4295D865B00C64E12 /* Publisher+UIControl.swift in Sources */, CE0D9FD329648DA300CEB5CD /* CustomAlertVC.swift in Sources */, CEB841702963360800BF8080 /* CountDownVC.swift in Sources */, + DA20D84E2966A9B300F1581F /* SearchVC.swift in Sources */, CE6655EC295D88D000C64E12 /* UITableView+.swift in Sources */, CEEC6B3A2961C4F300D00E1E /* CourseDrawingHomeVC.swift in Sources */, CEC2A6902962B06C00160BF7 /* convertLocationObject.swift in Sources */, diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/VC/CourseDiscoveryVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/VC/CourseDiscoveryVC.swift index a31a5bd6..611839a2 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/VC/CourseDiscoveryVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/VC/CourseDiscoveryVC.swift @@ -13,14 +13,13 @@ import SnapKit final class CourseDiscoveryVC: UIViewController { // MARK: - Properties private lazy var navibar = CustomNavigationBar(self, type: .title).setTitle("코스 발견") - private let searchButton = UIImageView().then { - $0.image = ImageLiterals.icSearch + private let searchButton = UIButton(type: .system).then { + $0.setImage(ImageLiterals.icSearch, for: .normal) + $0.tintColor = .g1 } - private let plusButton = UIImageView().then { - $0.image = ImageLiterals.icPlus - + private let plusButton = UIButton(type: .system).then { + $0.setImage(ImageLiterals.icPlus, for: .normal) } - // MARK: - UIComponents private lazy var containerView = UIScrollView() private let adImageView = UIImageView().then { @@ -58,6 +57,7 @@ final class CourseDiscoveryVC: UIViewController { }() // MARK: - Constants + var mapList: [MapModel] = [ MapModel(mapImage: "", title: "제목제목제목제목", location: "00동00구"), MapModel(mapImage: "", title: "제목제목제목제목", location: "00동00구"), @@ -68,8 +68,6 @@ final class CourseDiscoveryVC: UIViewController { MapModel(mapImage: "", title: "제목제목제목제목", location: "00동00구"), MapModel(mapImage: "", title: "제목제목제목제목", location: "00동00구") ] - // MARK: - Constants - final let inset: UIEdgeInsets = UIEdgeInsets(top: 10, left: 16, bottom: 0, right: 16) final let lineSpacing: CGFloat = 10 final let interItemSpacing: CGFloat = 20 @@ -80,12 +78,34 @@ final class CourseDiscoveryVC: UIViewController { register() setNavigationBar() layout() + setAddTarget() } } -// MARK: - Extension - extension CourseDiscoveryVC { + // MARK: - Methods + private func setAddTarget() { + self.searchButton.addTarget(self, action: #selector(presentToSearchVC), for: .touchUpInside) + self.plusButton.addTarget(self, action: #selector(presentToDiscoveryVC), for: .touchUpInside) + } +} + + // MARK: - @objc Function + + extension CourseDiscoveryVC { + @objc private func presentToSearchVC() { + let nextVC = SearchVC() + nextVC.modalPresentationStyle = .overFullScreen + self.present(nextVC, animated: true) + } + @objc private func presentToDiscoveryVC() { + let nextVC = PlusDetailVC() + nextVC.modalPresentationStyle = .overFullScreen + self.present(nextVC, animated: true) + } + } + // MARK: - UI & Layout +extension CourseDiscoveryVC { private func setNavigationBar() { view.addSubview(navibar) view.addSubview(searchButton) @@ -103,7 +123,6 @@ extension CourseDiscoveryVC { private func layout() { view.backgroundColor = .w1 containerView.backgroundColor = .clear -// mapCollectionView.backgroundColor = .systemGray4 view.addSubview(containerView) view.addSubview(plusButton) self.view.bringSubviewToFront(plusButton) @@ -142,13 +161,16 @@ extension CourseDiscoveryVC { } plusButton.snp.makeConstraints { make in make.trailing.equalTo(self.view.safeAreaLayoutGuide).inset(16) - make.bottom.equalTo(self.view.safeAreaLayoutGuide).inset(50) + make.bottom.equalTo(self.view.safeAreaLayoutGuide).inset(20) } } + // MARK: - register + private func register() { mapCollectionView.register(MapCollectionViewCell.self, forCellWithReuseIdentifier: MapCollectionViewCell.identifier) } } + // MARK: - UICollectionViewDelegateFlowLayout extension CourseDiscoveryVC: UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/PlusDetailViewController.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/PlusDetailVC.swift similarity index 78% rename from Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/PlusDetailViewController.swift rename to Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/PlusDetailVC.swift index ace76d77..1137291f 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/PlusDetailViewController.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/PlusDetailVC.swift @@ -7,7 +7,7 @@ import UIKit -class PlusDetailViewController: UIViewController { +class PlusDetailVC: UIViewController { override func viewDidLoad() { super.viewDidLoad() diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/SearchVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/SearchVC.swift new file mode 100644 index 00000000..90b38b45 --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/SearchVC.swift @@ -0,0 +1,29 @@ +// +// SearchVC.swift +// Runnect-iOS +// +// Created by YEONOO on 2023/01/05. +// + +import UIKit + +class SearchVC: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + // Do any additional setup after loading the view. + } + + + /* + // MARK: - Navigation + + // In a storyboard-based application, you will often want to do a little preparation before navigation + override func prepare(for segue: UIStoryboardSegue, sender: Any?) { + // Get the new view controller using segue.destination. + // Pass the selected object to the new view controller. + } + */ + +}