Skip to content

Commit aa01c55

Browse files
authored
Merge pull request #7 from engingulek/feature/confirm-protocols-and-added-libraries
Feature/confirm protocols and added libraries
2 parents 5e650ee + 2c6a35d commit aa01c55

11 files changed

Lines changed: 847 additions & 0 deletions

File tree

.DS_Store

6 KB
Binary file not shown.

ICTMDBHomeModule.xcodeproj/project.pbxproj

Lines changed: 475 additions & 0 deletions
Large diffs are not rendered by default.

ICTMDBHomeModule.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ICTMDBHomeModule.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 87 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ICTMDBHomeModule/Enums.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//
2+
// Enums.swift
3+
// ICTMDBHomeModule
4+
//
5+
// Created by Engin Gülek on 12.11.2025.
6+
//
7+
8+
enum CellItemType {
9+
case popular
10+
case airing
11+
case none
12+
}
13+
14+
//MARK: SectionType
15+
enum SectionType: Int, CaseIterable {
16+
case popular
17+
case onAir
18+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
//
2+
// HomeInteractor.swift
3+
// ICTMDBHomeModule
4+
//
5+
// Created by Engin Gülek on 12.11.2025.
6+
//
7+
8+
9+
final class HomeInteractor : PresenterToInteractorHomeProtocol {
10+
var presenter: (any InteractorToPresenterHomeProtocol)?
11+
12+
func loadPopularMovies() {
13+
14+
}
15+
16+
func loadAiringMovies() {
17+
18+
}
19+
}
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
//
2+
// HomePresenter.swift
3+
// ICTMDBHomeModule
4+
//
5+
// Created by Engin Gülek on 12.11.2025.
6+
//
7+
8+
import Foundation
9+
import GenericCollectionViewKit
10+
import ICTMDBViewKit
11+
12+
//MARK: CellItemType
13+
14+
15+
//MARK: HomePresenter
16+
final class HomePresenter {
17+
typealias CellItem = CellItemType
18+
weak var view: PresenterToViewHomeProtocol?
19+
private var interactor : PresenterToInteractorHomeProtocol
20+
private var router : PresenterToRouterHomeProtocol
21+
init(view: PresenterToViewHomeProtocol?,
22+
interactor:PresenterToInteractorHomeProtocol,
23+
router : PresenterToRouterHomeProtocol
24+
) {
25+
self.view = view
26+
self.interactor = interactor
27+
self.router = router
28+
}
29+
}
30+
31+
//MARK: HomePresenter : ViewToPresenterHomeProtocol
32+
extension HomePresenter : ViewToPresenterHomeProtocol {
33+
34+
35+
func viewDidLoad() {
36+
view?.setBackColorAble(color: "backColor")
37+
interactor.loadPopularMovies()
38+
interactor.loadAiringMovies()
39+
}
40+
}
41+
42+
//MARK: CollectionViewSources
43+
extension HomePresenter {
44+
func layout(for sectionIndex: Int) -> LayoutSource {
45+
46+
}
47+
48+
func numberOfRowsInSection(in section: Int) -> Int {
49+
50+
}
51+
52+
func numberOfSections() -> Int {
53+
54+
}
55+
56+
func cellForItem(section: Int,item:Int) -> CellItemType {
57+
58+
59+
60+
}
61+
62+
func didSelectItem(at indexPath: IndexPath) {
63+
64+
}
65+
66+
func titleForSection(at section: Int) ->(
67+
title: String, sizeType:SectionSizeType,
68+
buttonType: [TitleForSectionButtonType]?) {
69+
70+
71+
}
72+
73+
func onTappedTitleButton(buttonType: TitleForSectionButtonType, section: Int) {
74+
75+
}
76+
77+
func sectionType(at section: Int) -> SectionType {
78+
79+
}
80+
81+
func cellIdentifier(at section: Int) -> String {
82+
83+
}
84+
}
85+
86+
//MARK: HomePresenter: InteractorToPresenterHomeProtocol
87+
extension HomePresenter: InteractorToPresenterHomeProtocol {
88+
func sendAiringTvShows() {
89+
90+
}
91+
92+
func sendPopularTvShows() {
93+
94+
}
95+
96+
func sendError() {
97+
98+
}
99+
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
//
2+
// HomeProtocols.swift
3+
// ICTMDBHomeModule
4+
//
5+
// Created by Engin Gülek on 12.11.2025.
6+
//
7+
8+
import ICTMDBViewKit
9+
import GenericCollectionViewKit
10+
11+
12+
typealias Ables = UIViewAble & SegueAble
13+
14+
protocol ViewToPresenterHomeProtocol: AnyObject,
15+
GenericCollectionDataSourceProtocol,
16+
GenericCollectionDelegateSourceProtocol,
17+
GenericCollectionLayoutProviderProtocol{
18+
var view : PresenterToViewHomeProtocol? {get}
19+
func viewDidLoad()
20+
}
21+
22+
23+
protocol PresenterToViewHomeProtocol : AnyObject,Ables{
24+
func relaodCollectionView()
25+
func sendError(errorState: (isHidden:Bool,message:String))
26+
func startLoading()
27+
func finishLoading()
28+
}
29+
30+
31+
protocol PresenterToInteractorHomeProtocol {
32+
var presenter: InteractorToPresenterHomeProtocol? {get set}
33+
func loadPopularMovies()
34+
func loadAiringMovies()
35+
}
36+
37+
38+
protocol InteractorToPresenterHomeProtocol {
39+
func sendPopularTvShows()
40+
func sendAiringTvShows()
41+
func sendError()
42+
}
43+
44+
protocol PresenterToRouterHomeProtocol {
45+
func toAllListPage(view:PresenterToViewHomeProtocol?,type:SectionType)
46+
func toDetailPage(view:PresenterToViewHomeProtocol?,id:Int?)
47+
}
48+
49+

ICTMDBHomeModule/HomeRouter.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// HomeRouter.swift
3+
// ICTMDBHomeModule
4+
//
5+
// Created by Engin Gülek on 12.11.2025.
6+
//
7+
8+
import UIKit
9+
10+
public class HomeRouter : PresenterToRouterHomeProtocol {
11+
12+
13+
func toAllListPage(view:PresenterToViewHomeProtocol?,type:SectionType) {
14+
15+
}
16+
17+
func toDetailPage(view: (any PresenterToViewHomeProtocol)?, id: Int?) {
18+
19+
}
20+
21+
22+
23+
}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
//
2+
// HomeViewController.swift
3+
// ICTMDBHomeModule
4+
//
5+
// Created by Engin Gülek on 12.11.2025.
6+
//
7+
8+
import Foundation
9+
import UIKit
10+
import GenericCollectionViewKit
11+
import ICTMDBViewKit
12+
import SnapKit
13+
14+
15+
final class HomeViewController : UIViewController {
16+
var presenter: (any ViewToPresenterHomeProtocol)?
17+
18+
override func viewDidLoad() {
19+
super.viewDidLoad()
20+
}
21+
}
22+
23+
24+
25+
extension HomeViewController : PresenterToViewHomeProtocol {
26+
func relaodCollectionView() {
27+
28+
}
29+
30+
func sendError(errorState: (isHidden: Bool, message: String)) {
31+
32+
}
33+
34+
func startLoading() {
35+
36+
}
37+
38+
func finishLoading() {
39+
40+
}
41+
42+
43+
}

0 commit comments

Comments
 (0)