Skip to content

Commit 95032f5

Browse files
committed
added router actions
1 parent a8bbf68 commit 95032f5

1 file changed

Lines changed: 14 additions & 8 deletions

File tree

ICTMDBHomeModule/HomeRouter.swift

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,24 @@
66
//
77

88
import UIKit
9-
10-
public class HomeRouter : PresenterToRouterHomeProtocol {
11-
9+
import ICTMDBModularProtocols
10+
import DependencyKit
11+
import ICTMDBViewKit
12+
public class HomeRouter : @preconcurrency PresenterToRouterHomeProtocol {
1213

13-
func toAllListPage(view:PresenterToViewHomeProtocol?,type:SectionType) {
14-
14+
@MainActor func toAllListPage(view:PresenterToViewHomeProtocol?,type: SectionType) {
15+
let listType : AllListType = type == .popular ? .popular : .airingToday
16+
let allListModule = DependencyRegister.shared.resolve(AllListModuleProtocol.self)
17+
let allListViewController = allListModule.createAllListModule(type: listType)
18+
view?.pushViewControllerAble(allListViewController, animated: true)
19+
1520
}
1621

17-
func toDetailPage(view: (any PresenterToViewHomeProtocol)?, id: Int?) {
18-
22+
@MainActor func toDetailPage(view: (any PresenterToViewHomeProtocol)?, id: Int?) {
23+
let detailModule = DependencyRegister.shared.resolve(TvShowDetailProtocol.self)
24+
let detailViewController = detailModule.createTvShowDetailModule(id: id)
25+
view?.pushViewControllerAble(detailViewController, animated: true)
1926
}
2027

21-
2228

2329
}

0 commit comments

Comments
 (0)