-
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
🎁 Version 0.4.0 Epic Branch #71
Merged
Merged
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
Codecov Report
@@ Coverage Diff @@
## master #71 +/- ##
=======================================
Coverage 93.49% 93.49%
=======================================
Files 7 7
Lines 123 123
=======================================
Hits 115 115
Misses 8 8 Continue to review full report at Codecov.
|
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)
**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, nextTo: { Sample1AViewController() }) { (args) in args.stage.pushViewController(args.next, animated: true) return { args.stage.popViewController(animated: true) } } } } ```
…ecture-sequence [#79] Re Architecture SceneSequence And Several new feature
**Detail** - fixed `currnt` -> `current`
:hotfix: fix typo `current`
**Detail** This commit change `Scene`'s ReturnValue gained through `rewind method` was Optional to Non Optional. Because, it is inconvenient because it is necessary to check nil when receiving RetuneValue. **Breaking Change** initialize `TransitionRequest` have to change this. - before ```swift let request = HogeRequest() { ret in // result is optional guard let result = result else { return } // process using result } ``` - after ```swift let request = HogeRequest() { ret in // result is non-optional // process using result } ```
Change Scene's ReturnValue associetedType
**Abstruct** * SceneSequenceBuilder's Build method change to this before ```swift sequence = builder.build { (stage, scene) in 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() }) ``` after ```swift sequence = builder.build { let stage = $0.stage let scene = $0.firstScene stage.pushViewController(scene, animated: true) $0.execute.onActivate { (screens) in self.window?.rootViewController?.addChildViewController(stage) self.window?.rootViewController?.view.addSubview(stage.view) } $0.execute.onSuspend { (screens) in stage.view.removeFromSuperview() stage.removeFromParentViewController() } return { // rewind process } } ```
…_initializer 🔨 SceneSequenceBuilder add new builder interface
update podspec fo version up
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.
UPDATE at least