Skip to content

Commit eb49418

Browse files
authored
Merge pull request #607 from sopt-makers/refactor/#567-poke-flow
[Refactor] #567 - PokeFlow에서의 Router 의존성 제거
2 parents 30f3f35 + a96c489 commit eb49418

26 files changed

+797
-149
lines changed

SOPT-iOS/Projects/Features/DailySoptuneFeature/Sources/Coordinator/DailySoptuneCoordinator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ public final class DailySoptuneCoordinator: DefaultCoordinator {
2121
public var finishFlow: (() -> Void)?
2222

2323
private let factory: DailySoptuneFeatureBuildable
24-
private let pokeFactory: PokeFeatureBuildable
24+
private let pokeFactory: LegacyPokeFeatureBuildable
2525
private let router: LegacyRouter
2626

2727
private weak var rootController: UINavigationController?
2828

29-
public init(router: LegacyRouter, factory: DailySoptuneFeatureBuildable, pokeFactory: PokeFeatureBuildable) {
29+
public init(router: LegacyRouter, factory: DailySoptuneFeatureBuildable, pokeFactory: LegacyPokeFeatureBuildable) {
3030
self.router = router
3131
self.factory = factory
3232
self.pokeFactory = pokeFactory

SOPT-iOS/Projects/Features/DailySoptuneFeature/Sources/Coordinator/DailySoptuneResultCoordinator.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ public final class DailySoptuneResultCoordinator: DefaultCoordinator {
2222
public var finishFlow: (() -> Void)?
2323

2424
private let factory: DailySoptuneFeatureBuildable
25-
private let pokeFactory: PokeFeatureBuildable
25+
private let pokeFactory: LegacyPokeFeatureBuildable
2626
private let resultModel: DailySoptuneResultModel
2727
private let router: LegacyRouter
2828
private weak var rootController: UINavigationController?
2929
private weak var viewController: UIViewController?
3030

31-
public init(router: LegacyRouter, factory: DailySoptuneFeatureBuildable, pokeFactory: PokeFeatureBuildable, resultModel: DailySoptuneResultModel) {
31+
public init(router: LegacyRouter, factory: DailySoptuneFeatureBuildable, pokeFactory: LegacyPokeFeatureBuildable, resultModel: DailySoptuneResultModel) {
3232
self.router = router
3333
self.factory = factory
3434
self.pokeFactory = pokeFactory
@@ -98,7 +98,7 @@ public final class DailySoptuneResultCoordinator: DefaultCoordinator {
9898
guard let bottomSheet = self.pokeFactory
9999
.makePokeMessageTemplateBottomSheet(messageType: messageType)
100100
.vc
101-
.viewController as? PokeMessageTemplatesViewControllable
101+
.viewController as? LegacyPokeMessageTemplatesViewControllable
102102
else { return .empty() }
103103

104104
let bottomSheetManager = BottomSheetManager(configuration: .messageTemplate(minHeight: bottomSheet.minimumContentHeight))
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// DefaultPokeCoordinatorOutput.swift
3+
// PokeFeature
4+
//
5+
// Created by Jae Hyun Lee on 6/3/25.
6+
// Copyright © 2025 SOPT-iOS. All rights reserved.
7+
//
8+
9+
import BaseFeatureDependency
10+
11+
public protocol DefaultPokeCoordinatorOutput {
12+
func showPokeMain(isRouteFromRoot: Bool)
13+
}
14+
15+
public typealias DefaultPokeCoordinator = DefaultPokeCoordinatorOutput & DefaultCoordinator
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// LegacyPokeFeatureBuildable.swift
3+
// PokeFeatureInterface
4+
//
5+
// Created by sejin on 12/7/23.
6+
// Copyright © 2023 SOPT-iOS. All rights reserved.
7+
//
8+
9+
import Foundation
10+
11+
import Domain
12+
13+
public protocol LegacyPokeFeatureBuildable {
14+
func makePokeMain(isRouteFromRoot: Bool) -> LegacyPokeMainPresentable
15+
func makePokeMyFriends() -> LegacyPokeMyFriendsPresentable
16+
func makePokeMyFriendsList(relation: PokeRelation) -> LegacyPokeMyFriendsListPresentable
17+
func makePokeOnboarding() -> LegacyPokeOnboardingPresentable
18+
func makePokeMessageTemplateBottomSheet(messageType: PokeMessageType) -> LegacyPokeMessageTemplatesPresentable
19+
func makePokeNotificationList() -> LegacyPokeNotificationPresentable
20+
func makePokeMakingFriendCompleted(friendName: String) -> PokeMakingFriendCompletedPresentable
21+
func makePokeAnonymousFriendUpgrade(user: PokeUserModel) -> LegacyPokeAnonymousFriendUpgradePresentable
22+
}

SOPT-iOS/Projects/Features/PokeFeature/Interface/Sources/PokeAnonymousFriendUpgradePresentable.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
// Copyright © 2024 SOPT-iOS. All rights reserved.
77
//
88

9+
import UIKit
10+
911
import BaseFeatureDependency
1012
import Core
1113

12-
public protocol PokeAnonymousFriendUpgradePresentable: LegacyViewControllable { }
14+
public protocol LegacyPokeAnonymousFriendUpgradePresentable: LegacyViewControllable { }
15+
public protocol PokeAnonymousFriendUpgradePresentable: UIViewController { }

SOPT-iOS/Projects/Features/PokeFeature/Interface/Sources/PokeFeatureBuildable.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// PokeFeatureBuildable.swift
33
// PokeFeatureInterface
44
//
5-
// Created by sejin on 12/7/23.
6-
// Copyright © 2023 SOPT-iOS. All rights reserved.
5+
// Created by Jae Hyun Lee on 6/3/25.
6+
// Copyright © 2025 SOPT-iOS. All rights reserved.
77
//
88

99
import Foundation

SOPT-iOS/Projects/Features/PokeFeature/Interface/Sources/PokeMainPresentable.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// Copyright © 2023 SOPT-iOS. All rights reserved.
77
//
88

9+
import UIKit
10+
911
import BaseFeatureDependency
1012
import Core
1113
import Domain
@@ -24,4 +26,6 @@ public protocol PokeMainCoordinatable {
2426
}
2527

2628
public typealias PokeMainViewModelType = ViewModelType & PokeMainCoordinatable
27-
public typealias PokeMainPresentable = (vc: PokeMainViewControllable, vm: any PokeMainViewModelType)
29+
public typealias LegacyPokeMainPresentable = (vc: PokeMainViewControllable, vm: any PokeMainViewModelType)
30+
31+
public typealias PokeMainPresentable = (vc: UIViewController, vm: any PokeMainViewModelType)

SOPT-iOS/Projects/Features/PokeFeature/Interface/Sources/PokeMessageTemplatesPresentable.swift

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,18 @@
66
// Copyright © 2023 SOPT-iOS. All rights reserved.
77
//
88

9-
import Foundation
9+
import UIKit
10+
1011
import BaseFeatureDependency
1112
import Core
1213
import Domain
1314

14-
public protocol PokeMessageTemplatesViewControllable: LegacyViewControllable {
15+
public protocol LegacyPokeMessageTemplatesViewControllable: LegacyViewControllable {
16+
var minimumContentHeight: CGFloat { get }
17+
18+
func signalForClick() -> Driver<(PokeMessageModel, isAnonymous: Bool)>
19+
}
20+
public protocol PokeMessageTemplatesViewControllable: UIViewController {
1521
var minimumContentHeight: CGFloat { get }
1622

1723
func signalForClick() -> Driver<(PokeMessageModel, isAnonymous: Bool)>
@@ -22,5 +28,5 @@ public protocol PokeMessageTemplatesCoordinatable { }
2228
public protocol PokeMessageTemplatesViewModelType: ViewModelType & PokeMessageTemplatesCoordinatable {
2329
var messageType: PokeMessageType { get }
2430
}
31+
public typealias LegacyPokeMessageTemplatesPresentable = (vc: LegacyPokeMessageTemplatesViewControllable, vm: any PokeMessageTemplatesCoordinatable)
2532
public typealias PokeMessageTemplatesPresentable = (vc: PokeMessageTemplatesViewControllable, vm: any PokeMessageTemplatesCoordinatable)
26-

SOPT-iOS/Projects/Features/PokeFeature/Interface/Sources/PokeMyFriendsListPresentable.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// Copyright © 2023 SOPT-iOS. All rights reserved.
77
//
88

9+
import UIKit
10+
911
import BaseFeatureDependency
1012
import Core
1113
import Domain
@@ -23,4 +25,5 @@ public protocol PokeMyFriendsListViewModelType: ViewModelType & PokeMyFriendsLis
2325
var onAnonymousFriendUpgrade: ((PokeUserModel) -> Void)? { get set }
2426
}
2527

26-
public typealias PokeMyFriendsListPresentable = (vc: PokeMyFriendsListViewControllable, vm: any PokeMyFriendsListViewModelType)
28+
public typealias LegacyPokeMyFriendsListPresentable = (vc: PokeMyFriendsListViewControllable, vm: any PokeMyFriendsListViewModelType)
29+
public typealias PokeMyFriendsListPresentable = (vc: UIViewController, vm: any PokeMyFriendsListViewModelType)

SOPT-iOS/Projects/Features/PokeFeature/Interface/Sources/PokeMyFriendsPresentable.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
// Copyright © 2023 SOPT-iOS. All rights reserved.
77
//
88

9+
import UIKit
10+
911
import BaseFeatureDependency
1012
import Core
1113
import Domain
@@ -20,4 +22,6 @@ public protocol PokeMyFriendsCoordinatable {
2022
}
2123

2224
public typealias PokeMyFriendsViewModelType = ViewModelType & PokeMyFriendsCoordinatable
23-
public typealias PokeMyFriendsPresentable = (vc: PokeMyFriendsViewControllable, vm: any PokeMyFriendsViewModelType)
25+
public typealias LegacyPokeMyFriendsPresentable = (vc: PokeMyFriendsViewControllable, vm: any PokeMyFriendsViewModelType)
26+
27+
public typealias PokeMyFriendsPresentable = (vc: UIViewController, vm: any PokeMyFriendsViewModelType)

0 commit comments

Comments
 (0)