-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Re Architecture SceneSequence #81
Closed
Closed
Conversation
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
Abstract: - Set type parameter name as "${Target}Type" - Set type parameter name (declared with `associatedtype` ) as "${Target}" Note: - This commit will break following thing. - `ContextType` declared in `Scene` protocol. - `ContextType` must be replaced with `Context` .
Abstract: - Expand few variable names - Make variable name more clear
Abstract: - Update `ContextType` to `Context`
Abstract: - Adds test cases for SceneSequenceTest, SceneTest, ScreenTest
Abstract: - Set type parameter name as "${Target}Type" - Set type parameter name (declared with `associatedtype` ) as "${Target}" Note: - This commit will break following thing. - `ContextType` declared in `Scene` protocol. - `ContextType` must be replaced with `Context` .
Abstract: - Expand few variable names - Make variable name more clear
Now, `SceneSequence` cannot stop and maybe leak when dispose sub sequence. So, I have to remodel `SceneSequence` **UPDATE** - When SceneSequence's `leave` is called, SceneSequence will be able to be disposed. - SceneSequence's type generics `Context` is useless. So, SceneSequence's type generics match with First Scene. - SceneSequence's 'startWith' method is too difficult to use. if context is not set, SceneSequence refer to `self.context` . **Breaking Change** This commit has breaking change - `SceanSequence`'s `startWith` method deleted. instead of that method, start(on ~ **Hankey Changes** - SceneSequence override `leave`. But it is a update that we do not need. - So, this hankey update will be fixed later(maybe #74 fixed)
crexista
force-pushed
the
versions/0.4.0-SNAPSHOT/rearchitecture-sequence
branch
from
August 21, 2017 08:20
ad7e9ac
to
a3dd964
Compare
crexista
force-pushed
the
versions/0.4.0-SNAPSHOT/rearchitecture-sequence
branch
from
August 22, 2017 04:14
a3dd964
to
c4283a2
Compare
**Abstruct** 1. Scene, Scenario, Sequence are redesigned, and refactored 2. Some new feature added. **Refactor** **A. redefine deference screen and scene** `Screen` was just Scene's type erasure protocol And, `Screen` had `sendTransitionRequest` and `leaveFromCurrent`. but I redefine `Screen` and `Scene` as below. - Screen 1. Just Display, like a plate. 2. Screen has two status - activated - suspended - Scene 1. Scene is transitionable screen. 2. So, Scene has context and returnValue(when rewind) So, `Screen` does not have `sendTransitionRequest` and `leaveFromCurrent` from now. And, `Scene` has `sendTransitionRequest` and `leaveFromCurrent` insted of `Screen`. **B. SceneSequence separate to SceneCollection, ScreenContainer** `SceneSequence` become complex, so redesigned `SceneSequence` So, `SceneSequence` become to extend SceneCollection and implement ScreenContainer SceneCollection's job is stacking `Scene` and activate `Scene` detail will be write later.. **New Feature** - `Scene` can define associeated Type `ReturnValue` ReturnValue is type of argument to previous scene when rewind to back scene. can use like this ```swift // on Fist Scene sendTransitionRequest(SampleRequest(value){ (result: String) in print(result) }) // on Second Scene leaveFromCurrent(returnValue: String) // SampleRequest's ResultValue Type ``` - `SceneSequence` can suspend. `SceneSequence` become to be able to suspend. suspended screen cannot sendTransitionRequest(if request is send, it will be ignored) - `SceneSequenceBuilder` added. `SceneSequence`'s initial parameter is many. So `SceneSequenceBuilder` is maked. ```swift let builder = SceneSequence.builder(scene: scene, guide: rule) .setup(UINavigationController(rootViewController: UIViewController()), with: false) sequence = builder.build(onInvoke: { (stage, scene) in stage.isNavigationBarHidden = true stage.pushViewController(scene, animated: true) }, onActive: { (stage, screens) in self.window?.rootViewController?.addChildViewController(stage) self.window?.rootViewController?.view.addSubview(stage.view) }, onSuspend: { (stage, screens) in stage.view.removeFromSuperview() stage.removeFromParentViewController() }) sequence?.activate() ``` **Breaking Change** - `SceneOperation`'s I/F is changed. **old** ```swift operation.at(Sample1BViewController.self) { (scenario) in scenario.given(SampleARequest.self, { Sample1AViewController() }) { (args) in args.stage.pushViewController(args.next, animated: true) return { args.stage.popViewController(animated: true) } } } } ``` **new** ```swift operation.at(Sample1BViewController.self) { (scenario) in scenario.given(SampleARequest.self, transitTo: { Sample1AViewController() }) { (args) in args.stage.pushViewController(args.next, animated: true) return { args.stage.popViewController(animated: true) } } } } ```
crexista
force-pushed
the
versions/0.4.0-SNAPSHOT/rearchitecture-sequence
branch
from
August 22, 2017 04:15
c4283a2
to
bb5efce
Compare
this pull request to master. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Abstruct
Refactor
A. redefine deference screen and scene
Screen
was just Scene's type erasure protocolAnd,
Screen
hadsendTransitionRequest
andleaveFromCurrent
.but I redefine
Screen
andScene
as below.Screen
Scene
So,
Screen
does not havesendTransitionRequest
andleaveFromCurrent
from now.And,
Scene
hassendTransitionRequest
andleaveFromCurrent
insted ofScreen
.B. SceneSequence separate to SceneCollection, ScreenContainer
SceneSequence
become complex, so redesignedSceneSequence
So,
SceneSequence
become to extend SceneCollection and implement ScreenContainerSceneCollection's job is stacking
Scene
and activateScene
detail will be write later..
New Feature
Scene
can define associeated TypeReturnValue
ReturnValue is type of argument to previous scene when rewind to back scene.
can use like this
SceneSequence
can suspend.SceneSequence
become to be able to suspend.suspended screen cannot sendTransitionRequest(if request is send, it will be ignored)
SceneSequenceBuilder
added.SceneSequence
's initial parameter is many.So
SceneSequenceBuilder
is maked.Breaking Change
SceneOperation
's I/F is changed.old
new