Last active
December 16, 2015 09:06
-
-
Save eofster/7e93cc3dd9da3ac02c1a to your computer and use it in GitHub Desktop.
Interactor for presenting GPS track summary
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
| protocol TrackSummaryInteractorOutput { | |
| func update(track: TrackSummary) | |
| } | |
| class TrackSummaryInteractor { | |
| let repository: TrackRepository | |
| let output: TrackSummaryInteractorOutput | |
| init(repository: TrackRepository, output: TrackSummaryInteractorOutput) { | |
| self.repository = repository | |
| self.output = output | |
| } | |
| } | |
| extension TrackSummaryInteractor: Interactor { | |
| func execute() { | |
| // | |
| // Implement business logic using track repository to prepare track summary. | |
| // | |
| output.update( | |
| TrackSummary(trackID: 1, name: "Track", startTime: 1234567890, distance: 100) | |
| ) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment