Skip to content

Instantly share code, notes, and snippets.

@ethanjdiamond
Created January 29, 2017 19:38
Show Gist options
  • Save ethanjdiamond/3de6a176352c817ab3471ffbd590152b to your computer and use it in GitHub Desktop.
Save ethanjdiamond/3de6a176352c817ab3471ffbd590152b to your computer and use it in GitHub Desktop.
protocol Buildable: class {
associatedtype R: Routable
associatedtype I: Interactable
associatedtype P: Presentable
func build(store: AppStore) -> R!
func configure(store: AppStore, router: R, interactor: I, presenter: P?)
}
class Builder<R: Routable, I: Interactable, P: Presentable> {
func build(store: AppStore) -> R! {
return nil
}
func configure(store: AppStore, router: R, interactor: I, presenter: P?) {
router.configure(interactor: interactor, viewController: presenter?.viewController)
interactor.configure(store: store, router: router)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment