Created
July 30, 2018 10:00
-
-
Save atanasovdejan/012d1ee35ce964a946d4ad13bec18978 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
protocol TestPresentationLogic | |
{ | |
func presentFetchResults(response: Test.Fetch.Response) | |
} | |
class TestPresenter: TestPresentationLogic | |
{ | |
weak var viewController: TestDisplayLogic? | |
// MARK: - Presentation logic | |
func presentFetchResults(response: Test.Fetch.Response) { | |
// NOTE: Format the response from the Interactor and pass the result back to the View Controller | |
let viewModel = Test.Fetch.ViewModel(name: response.testObj?.name, date: response.testObj?.date, desc: response.testObj?.desc, isError: response.isError, message: response.message) | |
if viewModel.isError{ | |
viewController?.errorFetchingItems(viewModel: viewModel) | |
}else{ | |
viewController?.successFetchedItems(viewModel: viewModel) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment