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
20239fec
Commit
20239fec
authored
Dec 20, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finished rework for Motion
parent
601c787a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
20 deletions
+18
-20
Sources/Transition/MotionTransition+Start.swift
+18
-20
No files found.
Sources/Transition/MotionTransition+Start.swift
View file @
20239fec
...
@@ -53,14 +53,6 @@ extension MotionTransition {
...
@@ -53,14 +53,6 @@ extension MotionTransition {
prepareContainer
()
prepareContainer
()
prepareContext
()
prepareContext
()
for
v
in
preprocessors
{
v
.
motion
=
self
}
for
v
in
animators
{
v
.
motion
=
self
}
prepareViewHierarchy
()
prepareViewHierarchy
()
prepareAnimatingViews
()
prepareAnimatingViews
()
prepareToView
()
prepareToView
()
...
@@ -100,8 +92,8 @@ fileprivate extension MotionTransition {
...
@@ -100,8 +92,8 @@ fileprivate extension MotionTransition {
func
prepareSnapshotView
()
{
func
prepareSnapshotView
()
{
fullScreenSnapshot
=
transitionContainer
?
.
window
?
.
snapshotView
(
afterScreenUpdates
:
false
)
??
fromView
?
.
snapshotView
(
afterScreenUpdates
:
false
)
fullScreenSnapshot
=
transitionContainer
?
.
window
?
.
snapshotView
(
afterScreenUpdates
:
false
)
??
fromView
?
.
snapshotView
(
afterScreenUpdates
:
false
)
if
let
snapshot
=
fullScreenSnapshot
{
if
let
v
=
fullScreenSnapshot
{
(
transitionContainer
?
.
window
??
transitionContainer
)?
.
addSubview
(
snapshot
)
(
transitionContainer
?
.
window
??
transitionContainer
)?
.
addSubview
(
v
)
}
}
if
let
v
=
fromViewController
?
.
motionStoredSnapshot
{
if
let
v
=
fromViewController
?
.
motionStoredSnapshot
{
...
@@ -143,7 +135,7 @@ fileprivate extension MotionTransition {
...
@@ -143,7 +135,7 @@ fileprivate extension MotionTransition {
/// Prepares the transition container.
/// Prepares the transition container.
func
prepareTransitionContainer
()
{
func
prepareTransitionContainer
()
{
transitionContainer
?
.
isUserInteractionEnabled
=
false
transitionContainer
?
.
isUserInteractionEnabled
=
isUserInteractionEnabled
}
}
/// Prepares the view that holds all the animating views.
/// Prepares the view that holds all the animating views.
...
@@ -161,14 +153,22 @@ fileprivate extension MotionTransition {
...
@@ -161,14 +153,22 @@ fileprivate extension MotionTransition {
func
prepareContext
()
{
func
prepareContext
()
{
context
=
MotionContext
(
container
:
container
)
context
=
MotionContext
(
container
:
container
)
guard
let
fv
=
fromView
else
{
for
v
in
preprocessors
{
return
v
.
motion
=
self
}
for
v
in
animators
{
v
.
motion
=
self
}
}
guard
let
tv
=
toView
else
{
guard
let
tv
=
toView
else
{
return
return
}
}
guard
let
fv
=
fromView
else
{
return
}
context
.
loadViewAlpha
(
rootView
:
tv
)
context
.
loadViewAlpha
(
rootView
:
tv
)
container
.
addSubview
(
tv
)
container
.
addSubview
(
tv
)
...
@@ -185,12 +185,14 @@ fileprivate extension MotionTransition {
...
@@ -185,12 +185,14 @@ fileprivate extension MotionTransition {
/// Prepares the view hierarchy.
/// Prepares the view hierarchy.
func
prepareViewHierarchy
()
{
func
prepareViewHierarchy
()
{
if
(
.
auto
==
viewOrderStrategy
&&
if
(
.
auto
==
viewOrderStrategy
&&
!
isPresenting
&&
!
isTabBarController
)
||
!
isPresenting
&&
!
isTabBarController
)
||
.
sourceViewOnTop
==
viewOrderStrategy
{
.
sourceViewOnTop
==
viewOrderStrategy
{
context
.
insertToViewFirst
=
true
context
.
insertToViewFirst
=
true
}
}
for
v
in
preprocessors
{
v
.
process
(
fromViews
:
context
.
fromViews
,
toViews
:
context
.
toViews
)
}
}
}
/// Prepares the transition fromView & toView pairs.
/// Prepares the transition fromView & toView pairs.
...
@@ -204,8 +206,6 @@ fileprivate extension MotionTransition {
...
@@ -204,8 +206,6 @@ fileprivate extension MotionTransition {
return
false
return
false
}
}
print
(
"FROM PREPARED"
,
animatingFromViews
)
animatingToViews
=
context
.
toViews
.
filter
{
(
view
)
->
Bool
in
animatingToViews
=
context
.
toViews
.
filter
{
(
view
)
->
Bool
in
for
animator
in
animators
{
for
animator
in
animators
{
if
animator
.
canAnimate
(
view
:
view
,
isAppearing
:
true
)
{
if
animator
.
canAnimate
(
view
:
view
,
isAppearing
:
true
)
{
...
@@ -214,8 +214,6 @@ fileprivate extension MotionTransition {
...
@@ -214,8 +214,6 @@ fileprivate extension MotionTransition {
}
}
return
false
return
false
}
}
print
(
"TO PREPARED"
,
animatingFromViews
)
}
}
/// Prepares the to view.
/// Prepares the to view.
...
...
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