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
e5372859
Unverified
Commit
e5372859
authored
Jun 14, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated cherry-pick conflicts
parent
d7a293b6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
Sources/MotionController.swift
+15
-15
No files found.
Sources/MotionController.swift
View file @
e5372859
...
@@ -333,7 +333,7 @@ internal extension MotionController {
...
@@ -333,7 +333,7 @@ internal extension MotionController {
*/
*/
func
prepareTransition
()
{
func
prepareTransition
()
{
guard
isTransitioning
else
{
guard
isTransitioning
else
{
fatalError
()
return
}
}
prepareTransitionContainer
()
prepareTransitionContainer
()
...
@@ -346,22 +346,22 @@ internal extension MotionController {
...
@@ -346,22 +346,22 @@ internal extension MotionController {
/// Prepares the transition fromView & toView pairs.
/// Prepares the transition fromView & toView pairs.
func
prepareTransitionPairs
()
{
func
prepareTransitionPairs
()
{
guard
isTransitioning
else
{
guard
isTransitioning
else
{
fatalError
()
return
}
}
transitionPairs
=
[([
UIView
],
[
UIView
])]()
transitionPairs
=
[([
UIView
],
[
UIView
])]()
guard
let
v
=
animators
else
{
guard
let
a
=
animators
else
{
return
return
}
}
for
a
in
v
{
for
x
in
a
{
let
fv
=
context
.
fromViews
.
filter
{
(
view
:
UIView
)
->
Bool
in
let
fv
=
context
.
fromViews
.
filter
{
return
a
.
canAnimate
(
view
:
view
,
isAppearing
:
false
)
return
x
.
canAnimate
(
view
:
$0
,
isAppearing
:
false
)
}
}
let
tv
=
context
.
toViews
.
filter
{
(
view
:
UIView
)
->
Bool
in
let
tv
=
context
.
toViews
.
filter
{
return
a
.
canAnimate
(
view
:
view
,
isAppearing
:
true
)
return
x
.
canAnimate
(
view
:
$0
,
isAppearing
:
true
)
}
}
transitionPairs
?
.
append
((
fv
,
tv
))
transitionPairs
?
.
append
((
fv
,
tv
))
...
@@ -409,14 +409,14 @@ internal extension MotionController {
...
@@ -409,14 +409,14 @@ internal extension MotionController {
}
}
var
t
:
TimeInterval
=
0
var
t
:
TimeInterval
=
0
var
v
=
false
var
b
=
false
if
let
a
=
animators
,
let
tp
=
transitionPairs
{
if
let
a
=
animators
{
for
(
i
,
x
)
in
a
.
enumerated
()
{
for
(
i
,
x
)
in
a
.
enumerated
()
{
let
d
=
x
.
animate
(
fromViews
:
tp
[
i
]
.
0
,
toViews
:
tp
[
i
]
.
1
)
let
d
=
x
.
animate
(
fromViews
:
tp
[
i
]
.
0
,
toViews
:
tp
[
i
]
.
1
)
if
d
==
.
infinity
{
if
d
==
.
infinity
{
v
=
true
b
=
true
}
else
{
}
else
{
t
=
max
(
t
,
d
)
t
=
max
(
t
,
d
)
}
}
...
@@ -425,7 +425,7 @@ internal extension MotionController {
...
@@ -425,7 +425,7 @@ internal extension MotionController {
totalDuration
=
t
totalDuration
=
t
if
v
{
if
b
{
update
(
elapsedTime
:
0
)
update
(
elapsedTime
:
0
)
}
else
{
}
else
{
complete
(
after
:
t
,
isFinished
:
true
)
complete
(
after
:
t
,
isFinished
:
true
)
...
@@ -591,12 +591,12 @@ internal extension MotionController {
...
@@ -591,12 +591,12 @@ internal extension MotionController {
internal
extension
MotionController
{
internal
extension
MotionController
{
// should call this after `prepareTransitionPairs` & before `processContext`
// should call this after `prepareTransitionPairs` & before `processContext`
func
insert
<
T
>
(
preprocessor
:
MotionPreprocessor
,
before
:
T
.
Type
)
{
func
insert
<
T
>
(
preprocessor
:
MotionPreprocessor
,
before
:
T
.
Type
)
{
guard
var
v
=
preprocessors
else
{
guard
var
p
=
preprocessors
else
{
return
return
}
}
let
i
=
v
.
index
{
$0
is
T
}
??
v
.
count
let
i
=
p
.
index
{
$0
is
T
}
??
p
.
count
preprocessor
.
context
=
context
preprocessor
.
context
=
context
v
.
insert
(
preprocessor
,
at
:
i
)
p
.
insert
(
preprocessor
,
at
:
i
)
}
}
}
}
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