Last active
April 7, 2017 14:54
-
-
Save gracietti/b86a1c5e0e6c7395affa31200f69a7f3 to your computer and use it in GitHub Desktop.
Example of Contract
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 Foundation | |
protocol MainSearchView: BaseView { | |
func showCustomError(_ message: String?) | |
func updateVisibility(onSearchController willBeActive: Bool) | |
func showSearchResult(_ products: [Product]?, shouldAppend: Bool) | |
} | |
protocol MainSearchPresentation: class { | |
func onViewDidLoad() | |
func onWillPresentSearchController() | |
func onSearchTermChanged(to searchTerm: String) | |
func onProductFavoriteChanged(_ product: Product, to isFavorite: Bool) | |
func onProductSelected(_ product: Product) | |
func onInfiniteScrollTriggered() | |
} | |
protocol MainSearchUseCase: class { | |
func searchProducts(with searchTerm: String, onPage page: Int) | |
func updateProductFavorited(_ product: Product, to newValue: Bool) | |
} | |
protocol MainSearchInteractorOutput: class { | |
func onFetchProductsSuccess(_ products: [Product]?, shouldAppend: Bool) | |
func onFetchProductsFailure(message: String) | |
} | |
protocol MainSearchWireframe: class { | |
func showProductScreen(delegate: ProductScreenDelegate, product: Product?) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment