This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
100 additions
and
105 deletions.
There are no files selected for viewing
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
62 changes: 62 additions & 0 deletions
62
Examples/CleanseGithubBrowser/CleanseGithubBrowser/AppComponent.swift
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// | ||
// AppComponent.swift | ||
// CleanseGithubBrowser | ||
// | ||
// Created by holmes on 9/21/16. | ||
// Copyright © 2016 Square, Inc. All rights reserved. | ||
// | ||
|
||
import Cleanse | ||
|
||
struct ReleaseAppComponent : Cleanse.RootComponent { | ||
typealias Root = PropertyInjector<AppDelegate> | ||
typealias Scope = Singleton | ||
|
||
static func configure<B : Binder>(binder binder: B) { | ||
binder.install(module: CoreAppModule.self) | ||
|
||
binder.install(module: GithubServicesModule.self) | ||
binder.install(module: NetworkModule.self) | ||
} | ||
} | ||
|
||
#if DEBUG | ||
|
||
struct FakeAppComponent : Cleanse.RootComponent { | ||
typealias Root = PropertyInjector<AppDelegate> | ||
typealias Scope = Singleton | ||
|
||
static func configure<B : Binder>(binder binder: B) { | ||
binder.install(module: CoreAppModule.self) | ||
|
||
binder.install(module: FakeGithubServiceModule.self) | ||
binder.install(module: FakeModeSettingsModule.self) | ||
} | ||
} | ||
|
||
#endif | ||
|
||
struct CoreAppModule : Cleanse.Module { | ||
static func configure<B : Binder>(binder binder: B) { | ||
binder | ||
.bindPropertyInjectionOf(AppDelegate.self) | ||
.to(injector: AppDelegate.injectProperties) | ||
|
||
// We want to make it so the app uses "square" as the github user. | ||
binder | ||
.bind() | ||
.tagged(with: GithubOrganizationName.self) | ||
.to(value: "square") | ||
|
||
// Bind common dependencies. | ||
binder.install(module: FoundationCommonModule.self) | ||
binder.install(module: UIKitCommonModule.self) | ||
|
||
// This will wire up our root view controller. | ||
binder.install(module: RootViewController.Module.self) | ||
binder.install(module: SettingsSplitViewController.Module.self) | ||
|
||
binder.install(module: RepositoriesModule.self) | ||
binder.install(module: MembersModule.self) | ||
} | ||
} |
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
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
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
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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.