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
1dfc3fb8
Unverified
Commit
1dfc3fb8
authored
Jun 06, 2017
by
Daniel Dahan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated Motion identifier values and internal handling of associated objects
parent
398021c6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
244 additions
and
261 deletions
+244
-261
Motion.xcodeproj/project.pbxproj
+1
-5
Sources/Debug Plugin/MotionDebugView.swift
+5
-5
Sources/Extensions/Motion+CG.swift
+122
-102
Sources/Extensions/Motion+DispatchQueue.swift
+0
-37
Sources/Extensions/Motion+UIView.swift
+87
-83
Sources/Motion.swift
+1
-1
Sources/MotionContext.swift
+19
-19
Sources/MotionTransition+MotionStringConvertible.swift
+2
-2
Sources/MotionTransition.swift
+6
-6
Sources/Preprocessors/MatchPreprocessor.swift
+1
-1
No files found.
Motion.xcodeproj/project.pbxproj
View file @
1dfc3fb8
...
...
@@ -25,7 +25,6 @@
96AEB6951EE4610F009A3BE0
/* Motion+CALayer.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96AEB66F1EE4610F009A3BE0
/* Motion+CALayer.swift */
;
};
96AEB6961EE4610F009A3BE0
/* Motion+CAMediaTimingFunction.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96AEB6701EE4610F009A3BE0
/* Motion+CAMediaTimingFunction.swift */
;
};
96AEB6971EE4610F009A3BE0
/* Motion+CG.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96AEB6711EE4610F009A3BE0
/* Motion+CG.swift */
;
};
96AEB6981EE4610F009A3BE0
/* Motion+DispatchQueue.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96AEB6721EE4610F009A3BE0
/* Motion+DispatchQueue.swift */
;
};
96AEB6991EE4610F009A3BE0
/* Motion+UIKit.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96AEB6731EE4610F009A3BE0
/* Motion+UIKit.swift */
;
};
96AEB69A1EE4610F009A3BE0
/* Motion+UIView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96AEB6741EE4610F009A3BE0
/* Motion+UIView.swift */
;
};
96AEB69B1EE4610F009A3BE0
/* Motion+UIViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
96AEB6751EE4610F009A3BE0
/* Motion+UIViewController.swift */
;
};
...
...
@@ -69,7 +68,6 @@
96AEB66F1EE4610F009A3BE0
/* Motion+CALayer.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Motion+CALayer.swift"
;
sourceTree
=
"<group>"
;
};
96AEB6701EE4610F009A3BE0
/* Motion+CAMediaTimingFunction.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Motion+CAMediaTimingFunction.swift"
;
sourceTree
=
"<group>"
;
};
96AEB6711EE4610F009A3BE0
/* Motion+CG.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Motion+CG.swift"
;
sourceTree
=
"<group>"
;
};
96AEB6721EE4610F009A3BE0
/* Motion+DispatchQueue.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Motion+DispatchQueue.swift"
;
sourceTree
=
"<group>"
;
};
96AEB6731EE4610F009A3BE0
/* Motion+UIKit.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Motion+UIKit.swift"
;
sourceTree
=
"<group>"
;
};
96AEB6741EE4610F009A3BE0
/* Motion+UIView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Motion+UIView.swift"
;
sourceTree
=
"<group>"
;
};
96AEB6751EE4610F009A3BE0
/* Motion+UIViewController.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
"Motion+UIViewController.swift"
;
sourceTree
=
"<group>"
;
};
...
...
@@ -139,11 +137,10 @@
96AEB66F1EE4610F009A3BE0
/* Motion+CALayer.swift */
,
96AEB6701EE4610F009A3BE0
/* Motion+CAMediaTimingFunction.swift */
,
96AEB6711EE4610F009A3BE0
/* Motion+CG.swift */
,
96
AEB6721EE4610F009A3BE0
/* Motion+DispatchQueue
.swift */
,
96
3150D11EE50DA6002B0D42
/* Motion+Obj-C
.swift */
,
96AEB6731EE4610F009A3BE0
/* Motion+UIKit.swift */
,
96AEB6741EE4610F009A3BE0
/* Motion+UIView.swift */
,
96AEB6751EE4610F009A3BE0
/* Motion+UIViewController.swift */
,
963150D11EE50DA6002B0D42
/* Motion+Obj-C.swift */
,
963150D91EE51EB4002B0D42
/* MotionAnimationFillMode.swift */
,
);
path
=
Extensions
;
...
...
@@ -311,7 +308,6 @@
96AEB6961EE4610F009A3BE0
/* Motion+CAMediaTimingFunction.swift in Sources */
,
96AEB6941EE4610F009A3BE0
/* Motion+Array.swift in Sources */
,
96AEB6951EE4610F009A3BE0
/* Motion+CALayer.swift in Sources */
,
96AEB6981EE4610F009A3BE0
/* Motion+DispatchQueue.swift in Sources */
,
96AEB6A61EE4610F009A3BE0
/* MotionTypes.swift in Sources */
,
96AEB68E1EE4610F009A3BE0
/* MotionCoreAnimationViewContext.swift in Sources */
,
96AEB6921EE4610F009A3BE0
/* MotionDebugView.swift in Sources */
,
...
...
Sources/Debug Plugin/MotionDebugView.swift
View file @
1dfc3fb8
...
...
@@ -56,7 +56,7 @@ class MotionDebugView: UIView {
}
var
showOnTop
:
Bool
=
false
var
rotation
:
CGFloat
=
π
/
6
var
rotation
:
CGFloat
=
.
pi
/
6
var
scale
:
CGFloat
=
0.6
var
translation
:
CGPoint
=
.
zero
var
progress
:
Float
{
...
...
@@ -145,10 +145,10 @@ class MotionDebugView: UIView {
startRotation
=
rotation
}
rotation
=
startRotation
+
panGR
.
translation
(
in
:
nil
)
.
x
/
150
if
rotation
>
π
{
rotation
-=
2
*
π
}
else
if
rotation
<
-
π
{
rotation
+=
2
*
π
if
rotation
>
.
pi
{
rotation
-=
2
*
.
pi
}
else
if
rotation
<
-
.
pi
{
rotation
+=
2
*
.
pi
}
delegate
?
.
onPerspectiveChanged
(
translation
:
translation
,
rotation
:
rotation
,
scale
:
scale
)
}
...
...
Sources/Extensions/Motion+CG.swift
View file @
1dfc3fb8
This diff is collapsed.
Click to expand it.
Sources/Extensions/Motion+DispatchQueue.swift
deleted
100644 → 0
View file @
398021c6
/*
* The MIT License (MIT)
*
* Copyright (C) 2017, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.com>.
* All rights reserved.
*
* Original Inspiration & Author
* Copyright (c) 2016 Luke Zhao <me@lkzhao.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
import
Foundation
func
delay
(
_
time
:
Double
,
execute
:
@escaping
()
->
Void
)
{
if
time
>
0
{
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
time
,
execute
:
execute
)
}
else
{
DispatchQueue
.
main
.
async
(
execute
:
execute
)
}
}
Sources/Extensions/Motion+UIView.swift
View file @
1dfc3fb8
...
...
@@ -51,49 +51,101 @@ internal extension UIView {
}
}
public
extension
UIView
{
private
struct
AssociatedKeys
{
static
var
motionID
=
"motionID"
static
var
motionModifiers
=
"motionModifers"
static
var
motionStoredAlpha
=
"motionStoredAlpha"
static
var
motionEnabled
=
"motionEnabled"
}
/**
**motionID** is the identifier for the view. When doing a transition between two view controllers,
Motion will search through all the subviews for both view controllers and matches views with the same **motionID**.
fileprivate
var
MotionInstanceKey
:
UInt8
=
0
Whenever a pair is discovered,
Motion will automatically transit the views from source state to the destination state.
*/
@IBInspectable
public
var
motionID
:
String
?
{
get
{
return
objc_getAssociatedObject
(
self
,
&
AssociatedKeys
.
motionID
)
as?
String
}
set
{
objc_setAssociatedObject
(
self
,
&
AssociatedKeys
.
motionID
,
newValue
,
.
OBJC_ASSOCIATION_RETAIN_NONATOMIC
)
}
}
fileprivate
struct
MotionInstance
{
/// A boolean indicating whether Motion is enabled.
fileprivate
var
isEnabled
:
Bool
/// An optional reference to the motion identifier.
fileprivate
var
identifier
:
String
?
/// An optional reference to the motion animations.
fileprivate
var
animations
:
[
MotionAnimation
]?
/// An optional reference to the motion transition animations.
fileprivate
var
transitions
:
[
MotionTransition
]?
/// An alpha value.
fileprivate
var
alpha
:
CGFloat
?
}
/**
**isMotionEnabled** allows to specify whether a view and its subviews should be consider for animations.
If true, Motion will search through all the subviews for motionIds and modifiers. Defaults to true
*/
@IBInspectable
public
var
isMotionEnabled
:
Bool
{
get
{
return
objc_getAssociatedObject
(
self
,
&
AssociatedKeys
.
motionEnabled
)
as?
Bool
??
true
}
set
{
objc_setAssociatedObject
(
self
,
&
AssociatedKeys
.
motionEnabled
,
newValue
,
.
OBJC_ASSOCIATION_RETAIN_NONATOMIC
)
}
}
extension
UIView
{
/// MotionInstance reference.
fileprivate
var
motionInstance
:
MotionInstance
{
get
{
return
AssociatedObject
.
get
(
base
:
self
,
key
:
&
MotionInstanceKey
)
{
return
MotionInstance
(
isEnabled
:
true
,
identifier
:
nil
,
animations
:
nil
,
transitions
:
nil
,
alpha
:
1
)
}
}
set
(
value
)
{
AssociatedObject
.
set
(
base
:
self
,
key
:
&
MotionInstanceKey
,
value
:
value
)
}
}
/// A boolean that indicates whether motion is enabled.
@IBInspectable
public
var
isMotionEnabled
:
Bool
{
get
{
return
motionInstance
.
isEnabled
}
set
(
value
)
{
motionInstance
.
isEnabled
=
value
}
}
/// An identifier value used to connect views across UIViewControllers.
@IBInspectable
open
var
motionIdentifier
:
String
?
{
get
{
return
motionInstance
.
identifier
}
set
(
value
)
{
motionInstance
.
identifier
=
value
}
}
/// The animations to run.
open
var
motionAnimations
:
[
MotionAnimation
]?
{
get
{
return
motionInstance
.
animations
}
set
(
value
)
{
motionInstance
.
animations
=
value
}
}
/// The animations to run while in transition.
open
var
motionTransitions
:
[
MotionTransition
]?
{
get
{
return
motionInstance
.
transitions
}
set
(
value
)
{
motionInstance
.
transitions
=
value
}
}
/// The animations to run while in transition.
@IBInspectable
open
var
motionAlpha
:
CGFloat
?
{
get
{
return
motionInstance
.
alpha
}
set
(
value
)
{
motionInstance
.
alpha
=
value
}
}
}
/**
Use **motionModifiers** to specify animations alongside the main transition. Checkout `MotionTransition.swift` for available modifiers.
*/
public
var
motionModifiers
:
[
MotionTransition
]?
{
get
{
return
objc_getAssociatedObject
(
self
,
&
AssociatedKeys
.
motionModifiers
)
as?
[
MotionTransition
]
}
set
{
objc_setAssociatedObject
(
self
,
&
AssociatedKeys
.
motionModifiers
,
newValue
,
.
OBJC_ASSOCIATION_RETAIN_NONATOMIC
)
}
}
public
extension
UIView
{
/**
**motionModifierString** provides another way to set **motion
Modifier
s**. It can be assigned through storyboard.
**motionModifierString** provides another way to set **motion
Transition
s**. It can be assigned through storyboard.
*/
@IBInspectable
public
var
motionModifierString
:
String
?
{
get
{
fatalError
(
"Reverse lookup is not supported"
)
}
set
{
motion
Modifier
s
=
newValue
?
.
parse
()
}
set
{
motion
Transition
s
=
newValue
?
.
parse
()
}
}
internal
func
slowSnapshotView
()
->
UIView
{
...
...
@@ -117,54 +169,6 @@ public extension UIView {
}
return
isHidden
&&
(
superview
is
UICollectionView
||
self
is
UITableViewCell
)
?
[]
:
([
self
]
+
subviews
.
flatMap
{
$0
.
flattenedViewHierarchy
})
}
/// Used for .overFullScreen presentation
internal
var
motionStoredAlpha
:
CGFloat
?
{
get
{
if
let
doubleValue
=
(
objc_getAssociatedObject
(
self
,
&
AssociatedKeys
.
motionStoredAlpha
)
as?
NSNumber
)?
.
doubleValue
{
return
CGFloat
(
doubleValue
)
}
return
nil
}
set
{
if
let
newValue
=
newValue
{
objc_setAssociatedObject
(
self
,
&
AssociatedKeys
.
motionStoredAlpha
,
NSNumber
(
value
:
newValue
.
native
),
.
OBJC_ASSOCIATION_RETAIN_NONATOMIC
)
}
else
{
objc_setAssociatedObject
(
self
,
&
AssociatedKeys
.
motionStoredAlpha
,
nil
,
.
OBJC_ASSOCIATION_RETAIN_NONATOMIC
)
}
}
}
}
fileprivate
var
MotionInstanceKey
:
UInt8
=
0
fileprivate
struct
MotionInstance
{
/// An optional reference to the motion animations.
fileprivate
var
animations
:
[
MotionAnimation
]?
}
extension
UIView
{
/// MotionInstance reference.
fileprivate
var
motionInstance
:
MotionInstance
{
get
{
return
AssociatedObject
.
get
(
base
:
self
,
key
:
&
MotionInstanceKey
)
{
return
MotionInstance
(
animations
:
nil
)
}
}
set
(
value
)
{
AssociatedObject
.
set
(
base
:
self
,
key
:
&
MotionInstanceKey
,
value
:
value
)
}
}
/// The animations to run.
open
var
motionAnimations
:
[
MotionAnimation
]?
{
get
{
return
motionInstance
.
animations
}
set
(
value
)
{
motionInstance
.
animations
=
value
}
}
}
extension
UIView
{
...
...
Sources/Motion.swift
View file @
1dfc3fb8
...
...
@@ -111,7 +111,7 @@ public extension Motion {
}
/// Set the default animation for next transition
/// This usually overrides rootView's motion
Modifier
s during the transition
/// This usually overrides rootView's motion
Transition
s during the transition
///
/// - Parameter animation: animation type
func
setDefaultAnimationForNextTransition
(
_
animation
:
MotionDefaultAnimationType
)
{
...
...
Sources/MotionContext.swift
View file @
1dfc3fb8
...
...
@@ -29,8 +29,8 @@
import
UIKit
public
class
MotionContext
{
internal
var
motionI
D
ToSourceView
=
[
String
:
UIView
]()
internal
var
motionI
D
ToDestinationView
=
[
String
:
UIView
]()
internal
var
motionI
dentifier
ToSourceView
=
[
String
:
UIView
]()
internal
var
motionI
dentifier
ToDestinationView
=
[
String
:
UIView
]()
internal
var
snapshotViews
=
[
UIView
:
UIView
]()
internal
var
viewAlphas
=
[
UIView
:
CGFloat
]()
internal
var
targetStates
=
[
UIView
:
MotionTargetState
]()
...
...
@@ -45,18 +45,18 @@ public class MotionContext {
internal
func
set
(
fromViews
:
[
UIView
],
toViews
:
[
UIView
])
{
self
.
fromViews
=
fromViews
self
.
toViews
=
toViews
process
(
views
:
fromViews
,
idMap
:
&
motionI
D
ToSourceView
)
process
(
views
:
toViews
,
idMap
:
&
motionI
D
ToDestinationView
)
process
(
views
:
fromViews
,
idMap
:
&
motionI
dentifier
ToSourceView
)
process
(
views
:
toViews
,
idMap
:
&
motionI
dentifier
ToDestinationView
)
}
internal
func
process
(
views
:
[
UIView
],
idMap
:
inout
[
String
:
UIView
])
{
for
view
in
views
{
view
.
layer
.
removeAllAnimations
()
if
container
.
convert
(
view
.
bounds
,
from
:
view
)
.
intersects
(
container
.
bounds
)
{
if
let
motionI
D
=
view
.
motionID
{
idMap
[
motionI
D
]
=
view
if
let
motionI
dentifier
=
view
.
motionIdentifier
{
idMap
[
motionI
dentifier
]
=
view
}
if
let
modifiers
=
view
.
motion
Modifier
s
{
if
let
modifiers
=
view
.
motion
Transition
s
{
targetStates
[
view
]
=
MotionTargetState
(
modifiers
:
modifiers
)
}
}
...
...
@@ -83,24 +83,24 @@ public class MotionContext {
extension
MotionContext
{
/**
- Returns: a source view matching the motionI
D
, nil if not found
- Returns: a source view matching the motionI
dentifier
, nil if not found
*/
public
func
sourceView
(
for
motionI
D
:
String
)
->
UIView
?
{
return
motionI
DToSourceView
[
motionID
]
public
func
sourceView
(
for
motionI
dentifier
:
String
)
->
UIView
?
{
return
motionI
dentifierToSourceView
[
motionIdentifier
]
}
/**
- Returns: a destination view matching the motionI
D
, nil if not found
- Returns: a destination view matching the motionI
dentifier
, nil if not found
*/
public
func
destinationView
(
for
motionI
D
:
String
)
->
UIView
?
{
return
motionI
DToDestinationView
[
motionID
]
public
func
destinationView
(
for
motionI
dentifier
:
String
)
->
UIView
?
{
return
motionI
dentifierToDestinationView
[
motionIdentifier
]
}
/**
- Returns: a view with the same motionI
D
, but on different view controller, nil if not found
- Returns: a view with the same motionI
dentifier
, but on different view controller, nil if not found
*/
public
func
pairedView
(
for
view
:
UIView
)
->
UIView
?
{
if
let
id
=
view
.
motionI
D
{
if
let
id
=
view
.
motionI
dentifier
{
if
sourceView
(
for
:
id
)
==
view
{
return
destinationView
(
for
:
id
)
}
else
if
destinationView
(
for
:
id
)
==
view
{
...
...
@@ -237,7 +237,7 @@ extension MotionContext {
}
snapshot
.
frame
=
containerView
.
convert
(
view
.
bounds
,
from
:
view
)
snapshot
.
motionI
D
=
view
.
motionID
snapshot
.
motionI
dentifier
=
view
.
motionIdentifier
hide
(
view
:
view
)
...
...
@@ -352,16 +352,16 @@ extension MotionContext {
return
snapshots
}
internal
func
loadViewAlpha
(
rootView
:
UIView
)
{
if
let
storedAlpha
=
rootView
.
motion
Stored
Alpha
{
if
let
storedAlpha
=
rootView
.
motionAlpha
{
rootView
.
alpha
=
storedAlpha
rootView
.
motion
Stored
Alpha
=
nil
rootView
.
motionAlpha
=
nil
}
for
subview
in
rootView
.
subviews
{
loadViewAlpha
(
rootView
:
subview
)
}
}
internal
func
storeViewAlpha
(
rootView
:
UIView
)
{
rootView
.
motion
Stored
Alpha
=
viewAlphas
[
rootView
]
rootView
.
motionAlpha
=
viewAlphas
[
rootView
]
for
subview
in
rootView
.
subviews
{
storeViewAlpha
(
rootView
:
subview
)
}
...
...
Sources/MotionTransition+MotionStringConvertible.swift
View file @
1dfc3fb8
...
...
@@ -102,8 +102,8 @@ extension MotionTransition: MotionStringConvertible {
}
return
.
cascade
(
delta
:
parameters
.
getDouble
(
0
)
??
0.02
,
direction
:
cascadeDirection
,
delayMatchedViews
:
parameters
.
getBool
(
2
)
??
false
)
case
"source"
:
if
let
motionI
D
=
parameters
.
get
(
0
)?
.
name
{
return
.
source
(
motionI
D
:
motionID
)
if
let
motionI
dentifier
=
parameters
.
get
(
0
)?
.
name
{
return
.
source
(
motionI
dentifier
:
motionIdentifier
)
}
case
"useGlobalCoordinateSpace"
:
return
.
useGlobalCoordinateSpace
...
...
Sources/MotionTransition.swift
View file @
1dfc3fb8
...
...
@@ -408,7 +408,7 @@ extension MotionTransition {
// other modifiers
extension
MotionTransition
{
/**
Transition from/to the state of the view with matching motionI
D
Transition from/to the state of the view with matching motionI
dentifier
Will also force the view to use global coordinate space.
The following layer properties will be animated from the given view.
...
...
@@ -430,11 +430,11 @@ extension MotionTransition {
borderColor
- Parameters:
- motionI
D
: the source view's motionId.
- motionI
dentifier
: the source view's motionId.
*/
public
static
func
source
(
motionI
D
:
String
)
->
MotionTransition
{
public
static
func
source
(
motionI
dentifier
:
String
)
->
MotionTransition
{
return
MotionTransition
{
targetState
in
targetState
.
source
=
motionI
D
targetState
.
source
=
motionI
dentifier
}
}
...
...
@@ -531,12 +531,12 @@ extension MotionTransition {
}
/**
ignore all motion
Modifier
s attributes for a view's direct subviews.
ignore all motion
Transition
s attributes for a view's direct subviews.
*/
public
static
var
ignoreSubviewModifiers
:
MotionTransition
=
.
ignoreSubviewModifiers
()
/**
ignore all motion
Modifier
s attributes for a view's subviews.
ignore all motion
Transition
s attributes for a view's subviews.
- Parameters:
- recursive: if false, will only ignore direct subviews' modifiers. default false.
*/
...
...
Sources/Preprocessors/MatchPreprocessor.swift
View file @
1dfc3fb8
...
...
@@ -31,7 +31,7 @@ import UIKit
class
MatchPreprocessor
:
BasePreprocessor
{
override
func
process
(
fromViews
:
[
UIView
],
toViews
:
[
UIView
])
{
for
tv
in
toViews
{
guard
let
id
=
tv
.
motionI
D
,
let
fv
=
context
.
sourceView
(
for
:
id
)
else
{
continue
}
guard
let
id
=
tv
.
motionI
dentifier
,
let
fv
=
context
.
sourceView
(
for
:
id
)
else
{
continue
}
var
tvState
=
context
[
tv
]
??
MotionTargetState
()
var
fvState
=
context
[
fv
]
??
MotionTargetState
()
...
...
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