Last active
July 6, 2021 18:46
-
-
Save seyitcodeit/6b48cfa56103429f179dce59f40b21b7 to your computer and use it in GitHub Desktop.
Builder Pattern example for Medium Post
This file contains 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
struct Builder { | |
func makeNewsViewController() -> UIViewController { | |
let cameraProvider = CameraDataProvider() | |
let commentorProvider = CommentorDataProvider() | |
let moderatorProvider = ModeratorDataProvider() | |
let tableProvider = TableDataProvider() | |
let useCase = MyUseCase( | |
cameraProvider: cameraProvider, | |
commentorProvider: commentorProvider, | |
moderatorProvider: moderatorProvider, | |
tableProvider: tableProvider | |
) | |
let locationHandler = LocationAuthorizationHandler() | |
let viewModel = NewsViewModel(useCase: useCase) | |
return NewsViewController(viewmodel: viewModel, locationHandler: locationHandler) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment