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
25b99d44
Unverified
Commit
25b99d44
authored
Jun 14, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed the ability for plugins, transitionPairs, animators, and preprocessors to ever be nil
parent
54fc5fe5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
26 deletions
+25
-26
Sources/MotionController.swift
+24
-25
Sources/TransitionPreprocessor.swift
+1
-1
No files found.
Sources/MotionController.swift
View file @
25b99d44
...
@@ -107,16 +107,16 @@ public class MotionController: NSObject {
...
@@ -107,16 +107,16 @@ public class MotionController: NSObject {
internal
var
isFinished
=
true
internal
var
isFinished
=
true
/// An Array of MotionPreprocessors used during a transition.
/// An Array of MotionPreprocessors used during a transition.
internal
var
preprocessors
:
[
MotionPreprocessor
]
!
internal
fileprivate
(
set
)
lazy
var
preprocessors
=
[
MotionPreprocessor
]()
/// An Array of MotionAnimators used during a transition.
/// An Array of MotionAnimators used during a transition.
internal
var
animators
:
[
MotionAnimator
]
!
internal
fileprivate
(
set
)
lazy
var
animators
=
[
MotionAnimator
]()
/// An Array of MotionPlugins used during a transition.
/// An Array of MotionPlugins used during a transition.
internal
var
plugins
:
[
MotionPlugin
]
!
internal
fileprivate
(
set
)
lazy
var
plugins
=
[
MotionPlugin
]()
/// The matching fromViews to toViews based on the motionIdentifier value.
/// The matching fromViews to toViews based on the motionIdentifier value.
internal
var
transitionPairs
:
[(
fromViews
:
[
UIView
],
toViews
:
[
UIView
])]
!
internal
fileprivate
(
set
)
lazy
var
transitionPairs
=
[(
fromViews
:
[
UIView
],
toViews
:
[
UIView
])]()
/// Plugins that are enabled during the transition.
/// Plugins that are enabled during the transition.
internal
static
var
enabledPlugins
=
[
MotionPlugin
.
Type
]()
internal
static
var
enabledPlugins
=
[
MotionPlugin
.
Type
]()
...
@@ -328,8 +328,6 @@ internal extension MotionController {
...
@@ -328,8 +328,6 @@ internal extension MotionController {
return
return
}
}
transitionPairs
=
[([
UIView
],
[
UIView
])]()
for
a
in
animators
{
for
a
in
animators
{
let
fv
=
context
.
fromViews
.
filter
{
(
view
:
UIView
)
->
Bool
in
let
fv
=
context
.
fromViews
.
filter
{
(
view
:
UIView
)
->
Bool
in
return
a
.
canAnimate
(
view
:
view
,
isAppearing
:
false
)
return
a
.
canAnimate
(
view
:
view
,
isAppearing
:
false
)
...
@@ -351,8 +349,8 @@ internal extension MotionController {
...
@@ -351,8 +349,8 @@ internal extension MotionController {
return
return
}
}
for
v
in
preprocessors
{
for
x
in
preprocessors
{
v
.
process
(
fromViews
:
context
.
fromViews
,
toViews
:
context
.
toViews
)
x
.
process
(
fromViews
:
context
.
fromViews
,
toViews
:
context
.
toViews
)
}
}
}
}
...
@@ -439,18 +437,18 @@ internal extension MotionController {
...
@@ -439,18 +437,18 @@ internal extension MotionController {
let
completion
=
completionCallback
let
completion
=
completionCallback
transitionPairs
=
nil
transitionObservers
=
nil
transitionObservers
=
nil
transitionContainer
=
nil
transitionContainer
=
nil
completionCallback
=
nil
completionCallback
=
nil
container
=
nil
container
=
nil
preprocessors
=
nil
animators
=
nil
plugins
=
nil
context
=
nil
context
=
nil
beginTime
=
nil
beginTime
=
nil
elapsedTime
=
0
elapsedTime
=
0
totalDuration
=
0
totalDuration
=
0
preprocessors
.
removeAll
()
animators
.
removeAll
()
plugins
.
removeAll
()
transitionPairs
.
removeAll
()
completion
?(
isFinished
)
completion
?(
isFinished
)
}
}
...
@@ -481,24 +479,23 @@ fileprivate extension MotionController {
...
@@ -481,24 +479,23 @@ fileprivate extension MotionController {
/// Prepares the preprocessors.
/// Prepares the preprocessors.
func
preparePreprocessors
()
{
func
preparePreprocessors
()
{
preprocessors
=
[
for
x
in
[
IgnoreSubviewTransitionsPreprocessor
(),
IgnoreSubviewTransitionsPreprocessor
(),
MatchPreprocessor
(),
MatchPreprocessor
(),
SourcePreprocessor
(),
SourcePreprocessor
(),
CascadePreprocessor
(),
CascadePreprocessor
(),
DurationPreprocessor
()
DurationPreprocessor
()]
as
[
MotionPreprocessor
]
{
]
preprocessors
.
append
(
x
)
}
for
v
in
preprocessors
{
for
x
in
preprocessors
{
v
.
context
=
context
x
.
context
=
context
}
}
}
}
/// Prepares the animators.
/// Prepares the animators.
func
prepareAnimators
()
{
func
prepareAnimators
()
{
animators
=
[
animators
.
append
(
MotionDefaultAnimator
<
MotionCoreAnimationViewContext
>
())
MotionDefaultAnimator
<
MotionCoreAnimationViewContext
>
()
]
if
#available(iOS 10, tvOS 10, *)
{
if
#available(iOS 10, tvOS 10, *)
{
animators
.
append
(
MotionDefaultAnimator
<
MotionViewPropertyViewContext
>
())
animators
.
append
(
MotionDefaultAnimator
<
MotionViewPropertyViewContext
>
())
...
@@ -511,9 +508,11 @@ fileprivate extension MotionController {
...
@@ -511,9 +508,11 @@ fileprivate extension MotionController {
/// Prepares the plugins.
/// Prepares the plugins.
func
preparePlugins
()
{
func
preparePlugins
()
{
plugins
=
Motion
.
enabledPlugins
.
map
({
for
x
in
Motion
.
enabledPlugins
.
map
({
return
$0
.
init
()
return
$0
.
init
()
})
})
{
plugins
.
append
(
x
)
}
for
plugin
in
plugins
{
for
plugin
in
plugins
{
preprocessors
.
append
(
plugin
)
preprocessors
.
append
(
plugin
)
...
...
Sources/TransitionPreprocessor.swift
View file @
25b99d44
...
@@ -232,7 +232,7 @@ class TransitionPreprocessor: MotionPreprocessor {
...
@@ -232,7 +232,7 @@ class TransitionPreprocessor: MotionPreprocessor {
}
}
if
case
.
auto
=
defaultAnimation
{
if
case
.
auto
=
defaultAnimation
{
if
animators
!
.
contains
(
where
:
{
$0
.
canAnimate
(
view
:
tv
,
isAppearing
:
true
)
||
$0
.
canAnimate
(
view
:
fv
,
isAppearing
:
false
)
})
{
if
animators
.
contains
(
where
:
{
$0
.
canAnimate
(
view
:
tv
,
isAppearing
:
true
)
||
$0
.
canAnimate
(
view
:
fv
,
isAppearing
:
false
)
})
{
defaultAnimation
=
.
none
defaultAnimation
=
.
none
}
else
if
isNavigationController
{
}
else
if
isNavigationController
{
...
...
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