Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] HistoryViewController -> PostViewController 뷰 전환 기능 추가 #76

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 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
4 changes: 0 additions & 4 deletions GiwazipClient.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
9859985A29C0BFA000B21BD7 /* EnterCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9859985929C0BFA000B21BD7 /* EnterCoordinator.swift */; };
9859985C29C0C29F00B21BD7 /* SplashCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9859985B29C0C29F00B21BD7 /* SplashCoordinator.swift */; };
9859986229C22A0800B21BD7 /* PostingTextCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9859986129C22A0800B21BD7 /* PostingTextCoordinator.swift */; };
98738E1229C61F4300377B70 /* HistoryCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 98738E1129C61F4300377B70 /* HistoryCoordinator.swift */; };
9881559D29BC7CEB0049949A /* PostCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9881559C29BC7CEB0049949A /* PostCoordinator.swift */; };
9881559F29BC845A0049949A /* PostImageCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9881559E29BC845A0049949A /* PostImageCoordinator.swift */; };
988C56D029768F2D00018F07 /* SegmentViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 988C56CF29768F2D00018F07 /* SegmentViewController.swift */; };
Expand Down Expand Up @@ -104,7 +103,6 @@
9859985929C0BFA000B21BD7 /* EnterCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EnterCoordinator.swift; sourceTree = "<group>"; };
9859985B29C0C29F00B21BD7 /* SplashCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplashCoordinator.swift; sourceTree = "<group>"; };
9859986129C22A0800B21BD7 /* PostingTextCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostingTextCoordinator.swift; sourceTree = "<group>"; };
98738E1129C61F4300377B70 /* HistoryCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HistoryCoordinator.swift; sourceTree = "<group>"; };
9881559C29BC7CEB0049949A /* PostCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostCoordinator.swift; sourceTree = "<group>"; };
9881559E29BC845A0049949A /* PostImageCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PostImageCoordinator.swift; sourceTree = "<group>"; };
988C56CF29768F2D00018F07 /* SegmentViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SegmentViewController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -180,7 +178,6 @@
260A63DF29710834004034AD /* AppCoordinator.swift */,
9859985329C0B50D00B21BD7 /* DeveloperCoordinator.swift */,
9859985929C0BFA000B21BD7 /* EnterCoordinator.swift */,
98738E1129C61F4300377B70 /* HistoryCoordinator.swift */,
9859985729C0BBD700B21BD7 /* LicenseCoordinator.swift */,
9881559C29BC7CEB0049949A /* PostCoordinator.swift */,
9881559E29BC845A0049949A /* PostImageCoordinator.swift */,
Expand Down Expand Up @@ -471,7 +468,6 @@
98D44B722941DD4B00386AA4 /* AppDelegate.swift in Sources */,
26B7B11C29A3A2C200D3C3F7 /* TextLiteral.swift in Sources */,
9859985829C0BBD700B21BD7 /* LicenseCoordinator.swift in Sources */,
98738E1229C61F4300377B70 /* HistoryCoordinator.swift in Sources */,
9839F36F298B55350058639F /* SegmentCoordinator.swift in Sources */,
9881559F29BC845A0049949A /* PostImageCoordinator.swift in Sources */,
26B85B41299C61850039C14A /* SettingViewController.swift in Sources */,
Expand Down
9 changes: 4 additions & 5 deletions GiwazipClient/Coordinators/AppCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
// Created by 김민택 on 2023/01/13.
//

class AppCoordinator: BaseCoordinator, SplashCoordinatorDelegate,
EnterCoordinatorDelegate, SegmentCoordinatorDelegate,
class AppCoordinator: BaseCoordinator, EnterCoordinatorDelegate,
PostCoordinatorDelegate, PostImageCoordinatorDelegate,
SettingCoordinatorDelegate, SettingContentCoordinatorDelegate,
PostingCoordinatorDelegate {
PostingCoordinatorDelegate, SegmentCoordinatorDelegate,
SplashCoordinatorDelegate, SettingContentCoordinatorDelegate,
SettingCoordinatorDelegate {

var isLoggedIn = false

Expand All @@ -18,7 +18,6 @@ class AppCoordinator: BaseCoordinator, SplashCoordinatorDelegate,
override func start() {
if isLoggedIn {
showSegmentViewController()
// showPostViewController()
} else {
showSplashViewController()
}
Expand Down
30 changes: 0 additions & 30 deletions GiwazipClient/Coordinators/HistoryCoordinator.swift

This file was deleted.

7 changes: 6 additions & 1 deletion GiwazipClient/Coordinators/SegmentCoordinator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
protocol SegmentCoordinatorDelegate {
func presentPostingView()
func pushToSettingViewController()
func pushToPostViewController()
}

class SegmentCoordinator: BaseCoordinator, SegmentViewControllerDelegate {
Expand All @@ -28,8 +29,12 @@ class SegmentCoordinator: BaseCoordinator, SegmentViewControllerDelegate {
func presentPostingPhotoViewController() {
self.delegate?.presentPostingView()
}

func pushToSettingViewController() {
self.delegate?.pushToSettingViewController()
}

func pushToPostViewController() {
delegate?.pushToPostViewController()
}
}
1 change: 1 addition & 0 deletions GiwazipClient/Views/HistoryViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ extension HistoryViewController: UICollectionViewDelegate {

applyPostSnapshot()
} else {
delegate?.pushToPostViewController()
print("현재 클릭된 부분은 게시물의 \(indexPath)입니다.")
}
}
Expand Down
15 changes: 12 additions & 3 deletions GiwazipClient/Views/SegmentViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ import SnapKit
protocol SegmentViewControllerDelegate: AnyObject {
func presentPostingPhotoViewController()
func pushToSettingViewController()
func pushToPostViewController()
}

class SegmentViewController: BaseViewController {
class SegmentViewController: BaseViewController, HistoryViewControllerDelegate {

// MARK: - Property

Expand Down Expand Up @@ -65,10 +66,14 @@ class SegmentViewController: BaseViewController {
return $0
}(UIView())

private let workView = HistoryViewController()
private lazy var workView: HistoryViewController = {
$0.delegate = self
return $0
}(HistoryViewController())

private let inquiryView: HistoryViewController = {
private lazy var inquiryView: HistoryViewController = {
$0.isWorkView = false
$0.delegate = self
return $0
}(HistoryViewController())

Expand Down Expand Up @@ -222,6 +227,10 @@ class SegmentViewController: BaseViewController {
@objc func didTapSettingButton() {
delegate?.pushToSettingViewController()
}

func pushToPostViewController() {
delegate?.pushToPostViewController()
}
}

// MARK: - UIPageViewControllerDelegate, UIPageViewControllerDataSource
Expand Down