Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -214,9 +216,11 @@
DA20D840296696C300F1581F /* MapCollectionViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapCollectionViewCell.swift; sourceTree = "<group>"; };
DA20D8422966977D00F1581F /* SearchResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchResultViewController.swift; sourceTree = "<group>"; };
DA20D8442966979100F1581F /* DiscoveryDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DiscoveryDetailViewController.swift; sourceTree = "<group>"; };
DA20D846296697A600F1581F /* PlusDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlusDetailViewController.swift; sourceTree = "<group>"; };
DA20D848296697B400F1581F /* UploadViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadViewController.swift; sourceTree = "<group>"; };
DA20D846296697A600F1581F /* PlusDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlusDetailVC.swift; sourceTree = "<group>"; };
DA20D848296697B400F1581F /* UploadVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadVC.swift; sourceTree = "<group>"; };
DA20D84A296697C600F1581F /* UploadResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadResultViewController.swift; sourceTree = "<group>"; };
DA20D84D2966A9B300F1581F /* SearchVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchVC.swift; sourceTree = "<group>"; };
DA20D84F2966C0D500F1581F /* MapCollectionViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapCollectionViewController.swift; sourceTree = "<group>"; };
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 = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -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 = "<group>";
Expand Down Expand Up @@ -769,6 +774,7 @@
children = (
DA20D83E296696A000F1581F /* MapModel.swift */,
DA20D840296696C300F1581F /* MapCollectionViewCell.swift */,
DA20D84F2966C0D500F1581F /* MapCollectionViewController.swift */,
);
path = Reuse;
sourceTree = "<group>";
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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 */,
Expand All @@ -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 */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "original"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "제목제목제목제목제목"
Expand All @@ -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)
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//
// MapCollectionViewController.swift
// Runnect-iOS
//
// Created by YEONOO on 2023/01/05.
//

import UIKit

private let reuseIdentifier = "MapCollectionViewCell"

class MapCollectionViewController: UICollectionViewController {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 파일은 이제 사용하지 않고 있는거죠?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이거 복붙해서 쓰려고 남겨놓은 거긴한데...없앨까용 ..?🥺


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
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand All @@ -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구"),
Expand All @@ -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
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
}
*/

}
Loading