Created
December 15, 2015 13:16
-
-
Save eofster/f64963ad90ea717b20a9 to your computer and use it in GitHub Desktop.
GPS tracker interactor factory
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 InteractorFactory { | |
func createTrackSummaryInteractor(output: TrackSummaryInteractorOutput) -> Interactor | |
func createTrackNameUpdateInteractor(trackID: Int, name: String) -> Interactor | |
} | |
class InteractorFactoryImpl { | |
let repository: TrackRepository | |
init(repository: TrackRepository) { | |
self.repository = repository | |
} | |
} | |
extension InteractorFactoryImpl: InteractorFactory { | |
func createTrackSummaryInteractor(output: TrackSummaryInteractorOutput) -> Interactor { | |
return TrackSummaryInteractor(repository: repository, output: output) | |
} | |
func createTrackNameUpdateInteractor(trackID: Int, name: String) -> Interactor { | |
return TrackNameUpdateInteractor(repository: repository) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment