diff --git a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj index e74cadf1..dca176b1 100644 --- a/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj +++ b/Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj @@ -101,9 +101,11 @@ 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 */; }; - DA20D849296697B400F1581F /* UploadViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D848296697B400F1581F /* UploadViewController.swift */; }; + DA20D847296697A600F1581F /* PlusDetailVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D846296697A600F1581F /* PlusDetailVC.swift */; }; + DA20D849296697B400F1581F /* UploadVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D848296697B400F1581F /* UploadVC.swift */; }; DA20D84B296697C600F1581F /* UploadResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D84A296697C600F1581F /* UploadResultViewController.swift */; }; + DA20D84E2966A9B300F1581F /* SearchVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D84D2966A9B300F1581F /* SearchVC.swift */; }; + DA20D8502966C0D500F1581F /* MapCollectionViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DA20D84F2966C0D500F1581F /* MapCollectionViewController.swift */; }; /* End PBXBuildFile section */ /* Begin PBXFileReference section */ @@ -214,9 +216,11 @@ 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 = ""; }; - DA20D848296697B400F1581F /* UploadViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadViewController.swift; sourceTree = ""; }; + DA20D846296697A600F1581F /* PlusDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlusDetailVC.swift; sourceTree = ""; }; + DA20D848296697B400F1581F /* UploadVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadVC.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 = ""; }; + DA20D84F2966C0D500F1581F /* MapCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapCollectionViewController.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 */ @@ -428,9 +432,10 @@ CEEC6B432961C59F00D00E1E /* .gitkeep */, DA20D8422966977D00F1581F /* SearchResultViewController.swift */, DA20D8442966979100F1581F /* DiscoveryDetailViewController.swift */, - DA20D846296697A600F1581F /* PlusDetailViewController.swift */, - DA20D848296697B400F1581F /* UploadViewController.swift */, + DA20D846296697A600F1581F /* PlusDetailVC.swift */, + DA20D848296697B400F1581F /* UploadVC.swift */, DA20D84A296697C600F1581F /* UploadResultViewController.swift */, + DA20D84D2966A9B300F1581F /* SearchVC.swift */, ); path = Views; sourceTree = ""; @@ -769,6 +774,7 @@ children = ( DA20D83E296696A000F1581F /* MapModel.swift */, DA20D840296696C300F1581F /* MapCollectionViewCell.swift */, + DA20D84F2966C0D500F1581F /* MapCollectionViewController.swift */, ); path = Reuse; sourceTree = ""; @@ -929,7 +935,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 */, CE9291292965E01D0010959C /* RNTimeFormatter.swift in Sources */, CE6655D7295D86F900C64E12 /* String+.swift in Sources */, @@ -959,10 +965,12 @@ CE6655D0295D85FF00C64E12 /* CancelBag.swift in Sources */, DA20D83F296696A000F1581F /* MapModel.swift in Sources */, A3BC2F3D296468E500198261 /* UploadedCourseInfoModel.swift in Sources */, + DA20D8502966C0D500F1581F /* MapCollectionViewController.swift in Sources */, CE6655DC295D873500C64E12 /* UIButton+.swift in Sources */, 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 */, @@ -974,7 +982,7 @@ CEEC6B402961C55000D00E1E /* MyPageVC.swift in Sources */, CE665608295D921500C64E12 /* setImage.swift in Sources */, CE146770296568DC00DCEA1B /* RunTrackingVC.swift in Sources */, - DA20D849296697B400F1581F /* UploadViewController.swift in Sources */, + DA20D849296697B400F1581F /* UploadVC.swift in Sources */, CE665612295D92E400C64E12 /* UserDefaultWrapper.swift in Sources */, A3BC2F3A2963D0ED00198261 /* ActivityRecordInfoTVC.swift in Sources */, CE665610295D92C200C64E12 /* setTextLineHeight.swift in Sources */, diff --git a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_plus.imageset/Contents.json b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_plus.imageset/Contents.json index 337868b2..044ff80f 100644 --- a/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_plus.imageset/Contents.json +++ b/Runnect-iOS/Runnect-iOS/Global/Resource/Assets.xcassets/ic_plus.imageset/Contents.json @@ -19,5 +19,8 @@ "info" : { "author" : "xcode", "version" : 1 + }, + "properties" : { + "template-rendering-intent" : "original" } } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Reuse/MapCollectionViewCell.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Reuse/MapCollectionViewCell.swift index 52a98479..16ea0aa6 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Reuse/MapCollectionViewCell.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Reuse/MapCollectionViewCell.swift @@ -18,6 +18,7 @@ class MapCollectionViewCell: UICollectionViewCell { private let mapContainerView = UIView() private let mapImageView = UIImageView().then { $0.image = ImageLiterals.imgLogo + $0.layer.cornerRadius = 5 } private let titleLabel = UILabel().then { $0.text = "제목제목제목제목제목" @@ -29,9 +30,35 @@ class MapCollectionViewCell: UICollectionViewCell { $0.font = UIFont.b6 $0.textColor = UIColor.g2 } - private let heartButton = UIImageView().then { + let heartButton = UIImageView().then { $0.image = ImageLiterals.icHeartFill } + // MARK: - ClickAction Constants + var clickCount: Int = 0 { + didSet { + if clickCount == 0 { + mapImageView.backgroundColor = UIColor.systemGray4 + mapImageView.alpha = 1 + mapImageView.layer.borderColor = UIColor.w1.cgColor + mapImageView.layer.borderWidth = 0 } else { + mapImageView.backgroundColor = UIColor.m1 + mapImageView.alpha = 0.15 + mapImageView.layer.borderColor = UIColor.purple.cgColor + mapImageView.layer.borderWidth = 2 + } + } + } + override var isSelected: Bool { + didSet { + if !isSelected { + mapImageView.backgroundColor = UIColor.systemGray4 + mapImageView.alpha = 1 + mapImageView.layer.borderColor = UIColor.w1.cgColor + mapImageView.layer.borderWidth = 0 + clickCount = 0 + } + } + } // MARK: - Life cycle override init(frame: CGRect) { super.init(frame: frame) @@ -48,9 +75,11 @@ class MapCollectionViewCell: UICollectionViewCell { // MARK: - Extensions extension MapCollectionViewCell { + // MARK: - Function + // MARK: - Layout Helpers - private func layout() { + func layout() { contentView.backgroundColor = .clear mapImageView.backgroundColor = .systemGray4 [mapContainerView, mapImageView, titleLabel, locationLabel, heartButton].forEach { diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Reuse/MapCollectionViewController.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Reuse/MapCollectionViewController.swift new file mode 100644 index 00000000..a6359e26 --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Reuse/MapCollectionViewController.swift @@ -0,0 +1,56 @@ +// +// MapCollectionViewController.swift +// Runnect-iOS +// +// Created by YEONOO on 2023/01/05. +// + +import UIKit + +private let reuseIdentifier = "MapCollectionViewCell" + +class MapCollectionViewController: UICollectionViewController { + + override func viewDidLoad() { + super.viewDidLoad() + collectionView?.backgroundColor = .w1 + collectionView?.register(MapCollectionViewCell.self, forCellWithReuseIdentifier: reuseIdentifier) + } +} + +// MARK: - Constants + +let inset: UIEdgeInsets = UIEdgeInsets(top: 10, left: 16, bottom: 0, right: 16) +let lineSpacing: CGFloat = 10 +let interItemSpacing: CGFloat = 20 +let height: CGFloat = 164 + + // MARK: - UICollectionViewDelegateFlowLayout + +extension MapCollectionViewController: UICollectionViewDelegateFlowLayout { + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + let screenWidth = UIScreen.main.bounds.width + let doubleCellWidth = screenWidth - inset.left - inset.right - interItemSpacing + return CGSize(width: doubleCellWidth / 2, height: 164) + } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { + return lineSpacing + } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { + return interItemSpacing + } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { + return inset + } + // MARK: - UICollectionViewDataSourc + override func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return 20 + } + override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + guard let mapCell = collectionView.dequeueReusableCell( + withReuseIdentifier: MapCollectionViewCell.identifier, for: indexPath) + as? MapCollectionViewCell else { return UICollectionViewCell() } + + return mapCell + } +} diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/VC/CourseDiscoveryVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/VC/CourseDiscoveryVC.swift index f3abb5cc..897a2279 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 { @@ -42,7 +41,7 @@ final class CourseDiscoveryVC: UIViewController { return label }() - // MARK: - Reusable Components + // MARK: - collectionview private lazy var mapCollectionView: UICollectionView = { let layout = UICollectionViewFlowLayout() layout.scrollDirection = .vertical @@ -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 +// MARK: - Methods extension CourseDiscoveryVC { + 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() + self.navigationController?.pushViewController(nextVC, animated: true) + } + } + // MARK: - UI & Layout +extension CourseDiscoveryVC { private func setNavigationBar() { view.addSubview(navibar) view.addSubview(searchButton) @@ -103,7 +123,7 @@ extension CourseDiscoveryVC { private func layout() { view.backgroundColor = .w1 containerView.backgroundColor = .clear -// mapCollectionView.backgroundColor = .systemGray4 + self.tabBarController?.tabBar.isHidden = false view.addSubview(containerView) view.addSubview(plusButton) self.view.bringSubviewToFront(plusButton) @@ -142,14 +162,18 @@ 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) + mapCollectionView.register(MapCollectionViewCell.self, forCellWithReuseIdentifier: MapCollectionViewCell.identifier) } } + // MARK: - UICollectionViewDelegateFlowLayout + extension CourseDiscoveryVC: UICollectionViewDelegateFlowLayout { func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { let screenWidth = UIScreen.main.bounds.width diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/DiscoveryDetailViewController.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/DiscoveryDetailViewController.swift index 74ad1a81..55b975cd 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/DiscoveryDetailViewController.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/DiscoveryDetailViewController.swift @@ -12,18 +12,5 @@ class DiscoveryDetailViewController: 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. - } - */ - } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/PlusDetailVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/PlusDetailVC.swift new file mode 100644 index 00000000..58eaa676 --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/PlusDetailVC.swift @@ -0,0 +1,166 @@ +// +// PlusDetailViewController.swift +// Runnect-iOS +// +// Created by YEONOO on 2023/01/05. +// + +import UIKit +import Then + +class PlusDetailVC: UIViewController { + + // MARK: - UI Components + + private lazy var navibar = CustomNavigationBar(self, type: .titleWithLeftButton).setTitle("불러오기") + private let selectButton = CustomButton(title: "선택하기").setColor(bgColor: .g3, disableColor: .g3, textColor: .w1) + + // MARK: - collectionview + private lazy var containerView = UIScrollView() + private lazy var mapCollectionView: UICollectionView = { + let layout = UICollectionViewFlowLayout() + layout.scrollDirection = .vertical + + let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout) + collectionView.backgroundColor = .clear + collectionView.translatesAutoresizingMaskIntoConstraints = false + collectionView.isScrollEnabled = true + collectionView.showsVerticalScrollIndicator = false + collectionView.delegate = self + collectionView.dataSource = self + return collectionView + }() + // MARK: - Constants + + var mapList: [MapModel] = [ + MapModel(mapImage: "", title: "제목제목제목제목", location: "00동00구"), + MapModel(mapImage: "", title: "제목제목제목제목", location: "00동00구"), + MapModel(mapImage: "", title: "제목제목제목제목", location: "00동00구"), + MapModel(mapImage: "", title: "제목제목제목제목", location: "00동00구"), + MapModel(mapImage: "", title: "제목제목제목제목", location: "00동00구"), + MapModel(mapImage: "", title: "제목제목제목제목", location: "00동00구"), + MapModel(mapImage: "", title: "제목제목제목제목", location: "00동00구"), + MapModel(mapImage: "", title: "제목제목제목제목", location: "00동00구") + ] + final let inset: UIEdgeInsets = UIEdgeInsets(top: 10, left: 16, bottom: 0, right: 16) + final let lineSpacing: CGFloat = 10 + final let interItemSpacing: CGFloat = 20 + final let height: CGFloat = 164 + + // MARK: - Life Cycle + + override func viewDidLoad () { + super.viewDidLoad() + register() + setNavigationBar() + setUI() + setLayout() + setAddTarget() + } + + override func viewWillDisappear(_ animated: Bool) { + super.viewWillDisappear(animated) + self.tabBarController?.tabBar.isHidden = false + } +} +// MARK: - Methods + +extension PlusDetailVC { + private func setAddTarget() { + self.selectButton.addTarget(self, action: #selector(presentToUploadVC), for: .touchUpInside) + } +} + // MARK: - @objc Function + + extension PlusDetailVC { + @objc private func presentToUploadVC() { + let nextVC = UploadVC() + self.navigationController?.pushViewController(nextVC, animated: true) + } + } + // MARK: - naviVar Layout + +extension PlusDetailVC { + private func setNavigationBar() { + view.addSubview(navibar) + navibar.snp.makeConstraints { make in + make.top.leading.trailing.equalTo(view.safeAreaLayoutGuide) + make.height.equalTo(48) + } +} + // MARK: - setUI + private func setUI() { + view.backgroundColor = .w1 + containerView.backgroundColor = .clear + self.tabBarController?.tabBar.isHidden = true + } + // MARK: - Layout Helpers + private func setLayout() { + view.addSubview(containerView) + view.addSubview(selectButton) + self.view.bringSubviewToFront(selectButton) + containerView.addSubview(mapCollectionView) + + containerView.snp.makeConstraints { + $0.top.equalTo(self.navibar.snp.bottom) + $0.leading.trailing.bottom.equalTo(self.view.safeAreaLayoutGuide) + } + mapCollectionView.snp.makeConstraints { make in + make.top.equalToSuperview() + make.leading.trailing.equalTo(view.safeAreaLayoutGuide) + make.bottom.equalToSuperview() + make.height.equalTo(1000) + } + + selectButton.snp.makeConstraints { make in + make.leading.trailing.equalTo(view.safeAreaLayoutGuide).inset(16) + make.height.equalTo(44) + make.bottom.equalToSuperview().inset(34) + } + } + private func register() { + mapCollectionView.register(MapCollectionViewCell.self, forCellWithReuseIdentifier: MapCollectionViewCell.identifier) + } +} +// MARK: - UICollectionViewDelegateFlowLayout + +extension PlusDetailVC: UICollectionViewDelegateFlowLayout { + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize { + let screenWidth = UIScreen.main.bounds.width + let doubleCellWidth = screenWidth - inset.left - inset.right - interItemSpacing + return CGSize(width: doubleCellWidth / 2, height: 164) + } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat { + return lineSpacing + } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat { + return interItemSpacing + } + func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets { + return inset + } + func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { + let cell = collectionView.cellForItem(at: indexPath) as! MapCollectionViewCell + if cell.clickCount == 1 { + cell.clickCount = 0 + } else { + cell.clickCount += 1 + } + } +} +// MARK: - UICollectionViewDataSource + +extension PlusDetailVC: UICollectionViewDataSource { + func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { + return mapList.count + } + func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { + guard let mapCell = collectionView.dequeueReusableCell( + withReuseIdentifier: MapCollectionViewCell.identifier, for: indexPath) + as? MapCollectionViewCell else { return UICollectionViewCell() } + mapCell.dataBind(model: mapList[indexPath.item]) + mapCell.heartButton.isHidden = true + + return mapCell + } +} diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/SearchResultViewController.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/SearchResultViewController.swift index a0cfe4af..1809c44b 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/SearchResultViewController.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/SearchResultViewController.swift @@ -11,19 +11,6 @@ class SearchResultViewController: 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. - } - */ - + } 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..1fb30a10 --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/SearchVC.swift @@ -0,0 +1,16 @@ +// +// SearchVC.swift +// Runnect-iOS +// +// Created by YEONOO on 2023/01/05. +// + +import UIKit + +class SearchVC: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + view.backgroundColor = .red + } +} diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/UploadResultViewController.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/UploadResultViewController.swift index b22423cd..79218818 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/UploadResultViewController.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/UploadResultViewController.swift @@ -11,19 +11,6 @@ class UploadResultViewController: 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. } - */ } diff --git a/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/UploadVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/UploadVC.swift new file mode 100644 index 00000000..84b4a2a6 --- /dev/null +++ b/Runnect-iOS/Runnect-iOS/Presentation/CourseDiscovery/Views/UploadVC.swift @@ -0,0 +1,16 @@ +// +// UploadViewController.swift +// Runnect-iOS +// +// Created by YEONOO on 2023/01/05. +// + +import UIKit + +class UploadVC: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + + } +} diff --git a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift index 9b22f539..57bf95cf 100644 --- a/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift +++ b/Runnect-iOS/Runnect-iOS/Presentation/MyPage/VC/MyPageVC.swift @@ -302,5 +302,5 @@ extension MyPageVC { make.leading.trailing.equalToSuperview() make.height.equalTo(60) } - } + } }