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
7a639921
Commit
7a639921
authored
Dec 20, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor cleanups before MotionTransition review
parent
af4d74d4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
12 deletions
+13
-12
Sources/Animator/MotionCoreAnimationViewContext.swift
+1
-0
Sources/MotionTargetState.swift
+3
-3
Sources/Preprocessors/ConditionalPreprocessor.swift
+4
-4
Sources/Preprocessors/IgnoreSubviewModifiersPreprocessor.swift
+4
-4
Sources/Preprocessors/SourcePreprocessor.swift
+1
-1
No files found.
Sources/Animator/MotionCoreAnimationViewContext.swift
View file @
7a639921
...
...
@@ -277,6 +277,7 @@ fileprivate extension MotionCoreAnimationViewContext {
}
}
else
{
let
sizeRatio
=
oldSize
/
newSize
for
v
in
view
.
subviews
{
let
center
=
v
.
center
let
size
=
v
.
bounds
.
size
...
...
Sources/MotionTargetState.swift
View file @
7a639921
...
...
@@ -29,6 +29,9 @@
import
UIKit
public
struct
MotionTargetState
{
/// The identifier value to match source and destination views.
public
var
motionIdentifier
:
String
?
/// The initial state that the transition will start at.
internal
var
beginState
:
[
MotionModifier
]?
...
...
@@ -106,9 +109,6 @@ public struct MotionTargetState {
/// The arc curve value.
public
var
arc
:
CGFloat
?
/// The identifier value to match source and destination views.
public
var
motionIdentifier
:
String
?
/// The cascading animation settings.
public
var
cascade
:
(
TimeInterval
,
CascadeDirection
,
Bool
)?
...
...
Sources/Preprocessors/ConditionalPreprocessor.swift
View file @
7a639921
...
...
@@ -47,11 +47,11 @@ public struct MotionConditionalContext {
}
public
var
isMatched
:
Bool
{
return
matchedView
!=
nil
return
nil
!=
matchedView
}
public
var
isAncestorViewMatched
:
Bool
{
return
matchedAncestorView
!=
nil
return
nil
!=
matchedAncestorView
}
public
var
matchedView
:
UIView
?
{
...
...
@@ -101,9 +101,9 @@ class ConditionalPreprocessor: MotionCorePreprocessor {
continue
}
for
(
condition
,
transition
s
)
in
conditionalModifiers
{
for
(
condition
,
modifier
s
)
in
conditionalModifiers
{
if
condition
(
MotionConditionalContext
(
motion
:
motion
,
view
:
v
,
isAppearing
:
isAppearing
))
{
context
[
v
]
!.
append
(
contentsOf
:
transition
s
)
context
[
v
]
!.
append
(
contentsOf
:
modifier
s
)
}
}
}
...
...
Sources/Preprocessors/IgnoreSubviewModifiersPreprocessor.swift
View file @
7a639921
...
...
@@ -63,20 +63,20 @@ class IgnoreSubviewTransitionsPreprocessor: MotionCorePreprocessor {
continue
}
cleanSubview
Transition
s
(
for
:
parentView
)
cleanSubview
Modifier
s
(
for
:
parentView
)
}
}
}
fileprivate
extension
IgnoreSubviewTransitionsPreprocessor
{
/**
Clears the
transition
for a given view's subviews.
Clears the
modifiers
for a given view's subviews.
- Parameter for view: A UIView.
*/
func
cleanSubview
Transition
s
(
for
view
:
UIView
)
{
func
cleanSubview
Modifier
s
(
for
view
:
UIView
)
{
for
v
in
view
.
subviews
{
context
[
v
]
=
nil
cleanSubview
Transition
s
(
for
:
v
)
cleanSubview
Modifier
s
(
for
:
v
)
}
}
}
Sources/Preprocessors/SourcePreprocessor.swift
View file @
7a639921
...
...
@@ -44,7 +44,7 @@ class SourcePreprocessor: MotionCorePreprocessor {
}
for
tv
in
toViews
{
guard
let
i
=
context
[
tv
]?
.
motionIdentifier
,
let
fv
=
context
.
sourceView
(
for
:
i
)
else
{
guard
let
motionIdentifier
=
context
[
tv
]?
.
motionIdentifier
,
let
fv
=
context
.
sourceView
(
for
:
motionIdentifier
)
else
{
continue
}
...
...
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