Created
December 15, 2015 13:13
-
-
Save eofster/1a0268ce871364ca9145 to your computer and use it in GitHub Desktop.
GPS track summary view event handler
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
class TrackSummaryViewEventHandler { | |
let interactorFactory: InteractorFactory | |
let presenterFactory: PresenterFactory | |
init(interactorFactory: InteractorFactory, presenterFactory: PresenterFactory) { | |
self.interactorFactory = interactorFactory | |
self.presenterFactory = presenterFactory | |
} | |
} | |
extension TrackSummaryViewEventHandler: TrackSummaryViewObserver { | |
func viewShouldReloadData(view: TrackSummaryView) { | |
let interactor = interactorFactory.createTrackSummaryInteractor( | |
presenterFactory.createTrackSummaryPresenterWithOutput(view) | |
) | |
interactor.execute() | |
} | |
func view(view: TrackSummaryView, didChangeTrackName name: String, forTrackWithID trackID: Int) { | |
interactorFactory.createTrackNameUpdateInteractor(trackID, name: name).execute() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment