-
Notifications
You must be signed in to change notification settings - Fork 1
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
31 changed files
with
1,619 additions
and
25 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
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 |
---|---|---|
@@ -1,24 +1,29 @@ | ||
PODS: | ||
- RIBs (0.9.1): | ||
- RxSwift (~> 4.0) | ||
- RxCocoa (4.5.0): | ||
- RxSwift (>= 4.4.2, ~> 4.4) | ||
- RxSwift (4.5.0) | ||
- SnapKit (5.0.1) | ||
|
||
DEPENDENCIES: | ||
- RIBs (~> 0.9) | ||
- SnapKit (~> 5.0.0) | ||
- RIBs | ||
- RxCocoa | ||
- SnapKit | ||
|
||
SPEC REPOS: | ||
trunk: | ||
- RIBs | ||
- RxCocoa | ||
- RxSwift | ||
- SnapKit | ||
|
||
SPEC CHECKSUMS: | ||
RIBs: 879184fbca567425c488d6b3d14a9c5abfbf9d47 | ||
RxCocoa: cbf70265dc65a981d4ac982e513c10cf23df24a0 | ||
RxSwift: f172070dfd1a93d70a9ab97a5a01166206e1c575 | ||
SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb | ||
|
||
PODFILE CHECKSUM: b8f3e20bd14f0a6129105a0e926ce752d55b3d68 | ||
PODFILE CHECKSUM: 5958a1d48f49574bf1aaa346945aa5227424dddf | ||
|
||
COCOAPODS: 1.10.1 |
272 changes: 270 additions & 2 deletions
272
RIBs Study/RIBsStudy/RIBsStudy.xcodeproj/project.pbxproj
Large diffs are not rendered by default.
Oops, something went wrong.
88 changes: 88 additions & 0 deletions
88
RIBs Study/RIBsStudy/RIBsStudy.xcodeproj/xcshareddata/xcschemes/RIBsStudy.xcscheme
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,88 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Scheme | ||
LastUpgradeVersion = "1240" | ||
version = "1.3"> | ||
<BuildAction | ||
parallelizeBuildables = "YES" | ||
buildImplicitDependencies = "YES"> | ||
<BuildActionEntries> | ||
<BuildActionEntry | ||
buildForTesting = "YES" | ||
buildForRunning = "YES" | ||
buildForProfiling = "YES" | ||
buildForArchiving = "YES" | ||
buildForAnalyzing = "YES"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "F31AB9C7261585D700D7821D" | ||
BuildableName = "RIBsStudy.app" | ||
BlueprintName = "RIBsStudy" | ||
ReferencedContainer = "container:RIBsStudy.xcodeproj"> | ||
</BuildableReference> | ||
</BuildActionEntry> | ||
</BuildActionEntries> | ||
</BuildAction> | ||
<TestAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
shouldUseLaunchSchemeArgsEnv = "YES"> | ||
<Testables> | ||
<TestableReference | ||
skipped = "NO"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "F398CE2926252D0A00B144B9" | ||
BuildableName = "RIBsStudyTests.xctest" | ||
BlueprintName = "RIBsStudyTests" | ||
ReferencedContainer = "container:RIBsStudy.xcodeproj"> | ||
</BuildableReference> | ||
</TestableReference> | ||
</Testables> | ||
</TestAction> | ||
<LaunchAction | ||
buildConfiguration = "Debug" | ||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" | ||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" | ||
launchStyle = "0" | ||
useCustomWorkingDirectory = "NO" | ||
ignoresPersistentStateOnLaunch = "NO" | ||
debugDocumentVersioning = "YES" | ||
debugServiceExtension = "internal" | ||
allowLocationSimulation = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "F31AB9C7261585D700D7821D" | ||
BuildableName = "RIBsStudy.app" | ||
BlueprintName = "RIBsStudy" | ||
ReferencedContainer = "container:RIBsStudy.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</LaunchAction> | ||
<ProfileAction | ||
buildConfiguration = "Release" | ||
shouldUseLaunchSchemeArgsEnv = "YES" | ||
savedToolIdentifier = "" | ||
useCustomWorkingDirectory = "NO" | ||
debugDocumentVersioning = "YES"> | ||
<BuildableProductRunnable | ||
runnableDebuggingMode = "0"> | ||
<BuildableReference | ||
BuildableIdentifier = "primary" | ||
BlueprintIdentifier = "F31AB9C7261585D700D7821D" | ||
BuildableName = "RIBsStudy.app" | ||
BlueprintName = "RIBsStudy" | ||
ReferencedContainer = "container:RIBsStudy.xcodeproj"> | ||
</BuildableReference> | ||
</BuildableProductRunnable> | ||
</ProfileAction> | ||
<AnalyzeAction | ||
buildConfiguration = "Debug"> | ||
</AnalyzeAction> | ||
<ArchiveAction | ||
buildConfiguration = "Release" | ||
revealArchiveInOrganizer = "YES"> | ||
</ArchiveAction> | ||
</Scheme> |
51 changes: 51 additions & 0 deletions
51
RIBs Study/RIBsStudy/RIBsStudy/LoggedIn/LoggedInBuilder.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,51 @@ | ||
// | ||
// LoggedInBuilder.swift | ||
// RIBsStudy | ||
// | ||
// Created by Geonhyeong LIm on 2021/04/01. | ||
// | ||
|
||
import RIBs | ||
|
||
protocol LoggedInDependency: Dependency { | ||
// TODO: Make sure to convert the variable into lower-camelcase. | ||
var loggedInViewController: LoggedInViewControllable { get } | ||
// TODO: Declare the set of dependencies required by this RIB, but won't be | ||
// created by this RIB. | ||
} | ||
|
||
final class LoggedInComponent: Component<LoggedInDependency> { | ||
|
||
// TODO: Make sure to convert the variable into lower-camelcase. | ||
fileprivate var LoggedInViewController: LoggedInViewControllable { | ||
return dependency.loggedInViewController | ||
} | ||
|
||
// TODO: Declare 'fileprivate' dependencies that are only used by this RIB. | ||
} | ||
|
||
// MARK: - Builder | ||
|
||
protocol LoggedInBuildable: Buildable { | ||
func build(withListener listener: LoggedInListener) -> LoggedInRouting | ||
} | ||
|
||
final class LoggedInBuilder: Builder<LoggedInDependency>, LoggedInBuildable { | ||
|
||
override init(dependency: LoggedInDependency) { | ||
super.init(dependency: dependency) | ||
} | ||
|
||
func build(withListener listener: LoggedInListener) -> LoggedInRouting { | ||
let component = LoggedInComponent(dependency: dependency) | ||
let interactor = LoggedInInteractor() | ||
interactor.listener = listener | ||
|
||
let offGameBuilder = OffGameBuilder(dependency: component) | ||
let ticTacToeBuilder = TicTacToeBuilder(dependency: component) | ||
return LoggedInRouter(interactor: interactor, | ||
viewController: component.LoggedInViewController, | ||
offGameBuilder: offGameBuilder, | ||
ticTacToeBuilder: ticTacToeBuilder) | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
RIBs Study/RIBsStudy/RIBsStudy/LoggedIn/LoggedInComponent+OffGame.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,16 @@ | ||
// | ||
// LoggedInComponent+OffGame.swift | ||
// RIBsStudy | ||
// | ||
// Created by Geonhyeong LIm on 2021/04/08. | ||
// | ||
|
||
import RIBs | ||
|
||
protocol LoggedInDependencyOffGame: Dependency { | ||
|
||
} | ||
|
||
extension LoggedInComponent: OffGameDependency { | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
RIBs Study/RIBsStudy/RIBsStudy/LoggedIn/LoggedInComponent+TicTacToe.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,14 @@ | ||
// | ||
// LoggedInComponent+TicTacToe.swift | ||
// RIBsStudy | ||
// | ||
// Created by Geonhyeong LIm on 2021/04/08. | ||
// | ||
|
||
import RIBs | ||
|
||
protocol LoggedInDependencyTicTacToe: Dependency { | ||
|
||
} | ||
|
||
extension LoggedInComponent: TicTacToeDependency { } |
49 changes: 49 additions & 0 deletions
49
RIBs Study/RIBsStudy/RIBsStudy/LoggedIn/LoggedInInteractor.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,49 @@ | ||
// | ||
// LoggedInInteractor.swift | ||
// RIBsStudy | ||
// | ||
// Created by Geonhyeong LIm on 2021/04/01. | ||
// | ||
|
||
import RIBs | ||
import RxSwift | ||
|
||
protocol LoggedInRouting: Routing { | ||
func cleanupViews() | ||
func routeToTicTacToe() | ||
func routeToOffGame() | ||
} | ||
|
||
protocol LoggedInListener: class { | ||
// TODO: Declare methods the interactor can invoke to communicate with other RIBs. | ||
} | ||
|
||
final class LoggedInInteractor: Interactor, LoggedInInteractable { | ||
|
||
weak var router: LoggedInRouting? | ||
weak var listener: LoggedInListener? | ||
|
||
// TODO: Add additional dependencies to constructor. Do not perform any logic | ||
// in constructor. | ||
override init() {} | ||
|
||
override func didBecomeActive() { | ||
super.didBecomeActive() | ||
// TODO: Implement business logic here. | ||
} | ||
|
||
override func willResignActive() { | ||
super.willResignActive() | ||
|
||
router?.cleanupViews() | ||
// TODO: Pause any business logic. | ||
} | ||
|
||
func startTicTacToe() { | ||
router?.routeToTicTacToe() | ||
} | ||
|
||
func gameDidEnd() { | ||
router?.routeToOffGame() | ||
} | ||
} |
80 changes: 80 additions & 0 deletions
80
RIBs Study/RIBsStudy/RIBsStudy/LoggedIn/LoggedInRouter.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,80 @@ | ||
// | ||
// LoggedInRouter.swift | ||
// RIBsStudy | ||
// | ||
// Created by Geonhyeong LIm on 2021/04/01. | ||
// | ||
|
||
import RIBs | ||
|
||
protocol LoggedInInteractable: Interactable, OffGameListener, TicTacToeListener { | ||
var router: LoggedInRouting? { get set } | ||
var listener: LoggedInListener? { get set } | ||
} | ||
|
||
protocol LoggedInViewControllable: ViewControllable { | ||
func present(viewController: ViewControllable) | ||
func dismiss(viewController: ViewControllable) | ||
} | ||
|
||
final class LoggedInRouter: Router<LoggedInInteractable>, LoggedInRouting { | ||
|
||
// TODO: Constructor inject child builder protocols to allow building children. | ||
init(interactor: LoggedInInteractable, | ||
viewController: LoggedInViewControllable, | ||
offGameBuilder: OffGameBuildable, | ||
ticTacToeBuilder: TicTacToeBuildable) { | ||
self.viewController = viewController | ||
self.offGameBuilder = offGameBuilder | ||
self.ticTacToeBuilder = ticTacToeBuilder | ||
super.init(interactor: interactor) | ||
interactor.router = self | ||
} | ||
|
||
override func didLoad() { | ||
super.didLoad() | ||
attachOffGame() | ||
} | ||
|
||
func cleanupViews() { | ||
if let currentChild = currentChild { | ||
viewController.dismiss(viewController: currentChild.viewControllable) | ||
} | ||
} | ||
|
||
func routeToTicTacToe() { | ||
detachCurrentChild() | ||
let ticTacToe = ticTacToeBuilder.build(withListener: interactor) | ||
currentChild = ticTacToe | ||
attachChild(ticTacToe) | ||
viewController.present(viewController: ticTacToe.viewControllable) | ||
|
||
} | ||
|
||
func routeToOffGame() { | ||
detachCurrentChild() | ||
attachOffGame() | ||
} | ||
|
||
// MARK: - Private | ||
|
||
private let viewController: LoggedInViewControllable | ||
private let offGameBuilder: OffGameBuildable | ||
private let ticTacToeBuilder: TicTacToeBuildable | ||
|
||
private var currentChild: ViewableRouting? | ||
|
||
private func attachOffGame() { | ||
let offGame = offGameBuilder.build(withListener: interactor) | ||
self.currentChild = offGame | ||
attachChild(offGame) | ||
viewController.present(viewController: offGame.viewControllable) | ||
} | ||
|
||
private func detachCurrentChild() { | ||
if let currentchild = currentChild { | ||
detachChild(currentchild) | ||
viewController.dismiss(viewController: currentchild.viewControllable) | ||
} | ||
} | ||
} |
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.