Skip to content

Commit

Permalink
[fix] Runnect#39 - Button 기능 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-yeonwoo2 committed Jan 5, 2023
1 parent e7ee494 commit e7f20dd
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 17 deletions.
12 changes: 8 additions & 4 deletions Runnect-iOS/Runnect-iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -204,9 +205,10 @@
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>"; };
DA20D846296697A600F1581F /* PlusDetailVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlusDetailVC.swift; sourceTree = "<group>"; };
DA20D848296697B400F1581F /* UploadViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UploadViewController.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>"; };
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 @@ -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 = "<group>";
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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 */,
Expand Down
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 Down Expand Up @@ -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

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)
Expand All @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import UIKit

class PlusDetailViewController: UIViewController {
class PlusDetailVC: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
}
*/

}

0 comments on commit e7f20dd

Please sign in to comment.