Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
Motion
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitriy Stepanets
Motion
Commits
3e422773
Unverified
Commit
3e422773
authored
Jun 08, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
second round reworking the MotionController
parent
fcf3d822
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
15 deletions
+15
-15
Sources/Debug Plugin/MotionDebugPlugin.swift
+1
-1
Sources/Motion.swift
+12
-12
Sources/MotionController.swift
+0
-0
Sources/MotionIndependentController.swift
+2
-2
No files found.
Sources/Debug Plugin/MotionDebugPlugin.swift
View file @
3e422773
...
...
@@ -91,7 +91,7 @@ extension MotionDebugPlugin:MotionDebugViewDelegate {
public
func
onProcessSliderChanged
(
progress
:
Float
)
{
let
seekValue
=
Motion
.
shared
.
isPresenting
?
progress
:
1.0
-
progress
Motion
.
shared
.
update
(
progress
:
Double
(
seekValue
))
Motion
.
shared
.
update
(
elapsedTime
:
Double
(
seekValue
))
}
func
onPerspectiveChanged
(
translation
:
CGPoint
,
rotation
:
CGFloat
,
scale
:
CGFloat
)
{
...
...
Sources/Motion.swift
View file @
3e422773
...
...
@@ -166,12 +166,12 @@ fileprivate extension Motion {
prepareViewControllers
()
prepareSnapshotView
()
prepare
For
Transition
()
prepareTransition
()
prepareContext
()
prepareToView
()
prepareViewHierarchy
()
processContext
()
prepare
ForAnimation
()
prepare
TransitionPairs
()
processForAnimation
()
}
}
...
...
@@ -188,7 +188,7 @@ internal extension Motion {
fullScreenSnapshot
?
.
removeFromSuperview
()
}
override
func
complete
(
finished
:
Bool
)
{
override
func
complete
(
isFinished
finished
:
Bool
)
{
guard
isTransitioning
else
{
return
}
...
...
@@ -220,13 +220,13 @@ internal extension Motion {
}
// move fromView & toView back from our container back to the one supplied by UIKit
if
(
toOverFullScreen
&&
f
inished
)
||
(
fromOverFullScreen
&&
!
finished
)
{
transitionContainer
.
addSubview
(
f
inished
?
fromView
:
toView
)
if
(
toOverFullScreen
&&
isF
inished
)
||
(
fromOverFullScreen
&&
!
finished
)
{
transitionContainer
.
addSubview
(
isF
inished
?
fromView
:
toView
)
}
transitionContainer
.
addSubview
(
f
inished
?
toView
:
fromView
)
transitionContainer
.
addSubview
(
isF
inished
?
toView
:
fromView
)
if
isPresenting
!=
f
inished
,
!
isContainerController
{
if
isPresenting
!=
isF
inished
,
!
isContainerController
{
// only happens when present a .overFullScreen VC
// bug: http://openradar.appspot.com/radar?id=5320103646199808
UIApplication
.
shared
.
keyWindow
!.
addSubview
(
isPresenting
?
fromView
:
toView
)
...
...
@@ -249,7 +249,7 @@ internal extension Motion {
insertToViewFirst
=
false
defaultAnimation
=
.
auto
super
.
complete
(
finished
:
f
inished
)
super
.
complete
(
isFinished
:
isF
inished
)
if
finished
{
if
let
fvc
=
fvc
,
let
tvc
=
tvc
{
...
...
@@ -342,13 +342,13 @@ fileprivate extension Motion {
}
internal
extension
Motion
{
override
func
prepare
For
Transition
()
{
super
.
prepare
For
Transition
()
override
func
prepareTransition
()
{
super
.
prepareTransition
()
insert
(
preprocessor
:
DefaultAnimationPreprocessor
(
motion
:
self
),
before
:
DurationPreprocessor
.
self
)
}
override
func
prepare
ForAnimation
()
{
super
.
prepare
ForAnimation
()
override
func
prepare
TransitionPairs
()
{
super
.
prepare
TransitionPairs
()
context
.
hide
(
view
:
toView
)
}
}
...
...
Sources/MotionController.swift
View file @
3e422773
This diff is collapsed.
Click to expand it.
Sources/MotionIndependentController.swift
View file @
3e422773
...
...
@@ -37,11 +37,11 @@ public class MotionIndependentController: MotionController {
transitionContainer
=
rootView
completionCallback
=
completion
prepare
For
Transition
()
prepareTransition
()
context
.
defaultCoordinateSpace
=
.
sameParent
context
.
set
(
fromViews
:
fromViews
,
toViews
:
toViews
)
processContext
()
prepare
ForAnimation
()
prepare
TransitionPairs
()
animate
()
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment