@@ -51,28 +51,28 @@ final class HomePresenter {
5151
5252// MARK: - ViewToPresenterHomeProtocol
5353/// Handles actions triggered by the View layer.
54-
54+ @ MainActor
5555extension HomePresenter : ViewToPresenterHomeProtocol {
56-
5756
58-
57+
58+
5959 func viewDidLoad( ) {
6060 view? . setBackColorAble ( color: " backColor " )
6161 view? . setNavigationTitle ( title: LocalizableUI . homePageNavTitle. localized)
6262
63- Task { @ MainActor in
64- await loadData ( )
63+ Task {
64+ await loadData ( )
6565 }
6666 }
6767
68-
69- @ MainActor
68+
69+
7070 func loadData( ) async {
7171 view? . startLoading ( )
7272 await interactor. loadData ( )
7373 view? . finishLoading ( )
7474 }
75-
75+
7676}
7777
7878
@@ -100,11 +100,11 @@ extension HomePresenter {
100100 }
101101 }
102102
103-
103+
104104 func numberOfSections( ) -> Int {
105105 SectionType . allCases. count
106106 }
107-
107+
108108 func cellForItem( section: Int , item: Int ) -> CellItemType {
109109 guard let sectionType = SectionType ( rawValue: section) else { return . none }
110110 switch sectionType {
@@ -117,7 +117,7 @@ extension HomePresenter {
117117 }
118118 }
119119
120-
120+
121121 func didSelectItem( section: Int , item: Int ) {
122122 guard let sectionType = SectionType ( rawValue: section) else { return }
123123 switch sectionType {
@@ -154,7 +154,7 @@ extension HomePresenter {
154154 return headerViewItem
155155 }
156156
157-
157+
158158 func onTappedTitleButton( buttonType: TitleForSectionButtonType , section: Int ) {
159159 guard let sectionType = SectionType ( rawValue: section) else { return }
160160
@@ -195,30 +195,30 @@ extension HomePresenter {
195195/// Receives data from the Interactor and updates the view.
196196extension HomePresenter : InteractorToPresenterHomeProtocol {
197197 func sendError( ) {
198-
198+
199199 view? . sendError ( errorState: ( isHidden: true ,
200200 message: LocalizableUI . somethingWentWrong. localized) )
201201 view? . relaodCollectionView ( )
202-
202+
203203 }
204204
205205
206206 func sendAiringTvShows( _ data: [ AiringToday ] ) {
207-
207+
208208 airingTodayShows = data. map { AiringTodayPresentation ( tvShow: $0) }
209209 view? . sendError ( errorState: ( isHidden: false , message: " " ) )
210210 view? . relaodCollectionView ( )
211-
211+
212212 }
213213
214214 func sendPopularTvShows( _ data: [ PopularTvShows ] ) {
215-
215+
216216 popularTvShows = data
217217 . map { PopularTVShowPresentation ( tvShow: $0) }
218218 . sorted { $0. rating > $1. rating }
219219 view? . sendError ( errorState: ( isHidden: false , message: " " ) )
220220 view? . relaodCollectionView ( )
221-
221+
222222 }
223223}
224224
0 commit comments