Skip to content
This repository was archived by the owner on Aug 30, 2023. It is now read-only.

Commit ca89662

Browse files
authored
Add support for animating shadow color. (#99)
1 parent 55c23d5 commit ca89662

7 files changed

+17
-0
lines changed

src/MDMAnimatableKeyPaths.h

+10
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,16 @@ FOUNDATION_EXPORT MDMAnimatableKeyPath MDMKeyPathRotation NS_SWIFT_NAME(rotation
146146
*/
147147
FOUNDATION_EXPORT MDMAnimatableKeyPath MDMKeyPathScale NS_SWIFT_NAME(scale);
148148

149+
/**
150+
Shadow color.
151+
152+
Equivalent UIView property: N/A
153+
Equivalent CALayer property: shadowColor
154+
Expected value type: UIColor or CGColor.
155+
Additive animation supported: No.
156+
*/
157+
FOUNDATION_EXPORT MDMAnimatableKeyPath MDMKeyPathShadowColor NS_SWIFT_NAME(shadowColor);
158+
149159
/**
150160
Shadow offset.
151161

src/MDMAnimatableKeyPaths.m

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
MDMAnimatableKeyPath MDMKeyPathPosition = @"position";
2727
MDMAnimatableKeyPath MDMKeyPathRotation = @"transform.rotation.z";
2828
MDMAnimatableKeyPath MDMKeyPathScale = @"transform.scale";
29+
MDMAnimatableKeyPath MDMKeyPathShadowColor = @"shadowColor";
2930
MDMAnimatableKeyPath MDMKeyPathShadowOffset = @"shadowOffset";
3031
MDMAnimatableKeyPath MDMKeyPathShadowOpacity = @"shadowOpacity";
3132
MDMAnimatableKeyPath MDMKeyPathShadowRadius = @"shadowRadius";

src/private/MDMBlockAnimations.m

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
MDMKeyPathPosition,
3838
MDMKeyPathRotation,
3939
MDMKeyPathScale,
40+
MDMKeyPathShadowColor,
4041
MDMKeyPathShadowOffset,
4142
MDMKeyPathShadowOpacity,
4243
MDMKeyPathShadowRadius,

tests/unit/MotionAnimatorBehavioralTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class AnimatorBehavioralTests: XCTestCase {
5353
.position: CGPoint(x: 50, y: 20),
5454
.rotation: 42,
5555
.scale: 2.5,
56+
.shadowColor: UIColor.blue,
5657
.shadowOffset: CGSize(width: 1, height: 1),
5758
.shadowOpacity: 0.3,
5859
.shadowRadius: 5,

tests/unit/QuartzCoreBehavioralTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ class QuartzCoreBehavioralTests: XCTestCase {
7878
.position: CGPoint(x: 50, y: 20),
7979
.rotation: 42,
8080
.scale: 2.5,
81+
.shadowColor: UIColor.blue,
8182
.shadowOffset: CGSize(width: 1, height: 1),
8283
.shadowOpacity: 0.3,
8384
.shadowRadius: 5,

tests/unit/UIKitBehavioralTests.swift

+2
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ class UIKitBehavioralTests: XCTestCase {
141141
.borderWidth: 5,
142142
.borderColor: UIColor.red,
143143
.cornerRadius: 3,
144+
.shadowColor: UIColor.blue,
144145
.shadowOffset: CGSize(width: 1, height: 1),
145146
.shadowOpacity: 0.3,
146147
.shadowRadius: 5,
@@ -184,6 +185,7 @@ class UIKitBehavioralTests: XCTestCase {
184185
.position: CGPoint(x: 50, y: 20),
185186
.rotation: 42,
186187
.scale: 2.5,
188+
.shadowColor: UIColor.blue,
187189
.shadowOffset: CGSize(width: 1, height: 1),
188190
.shadowOpacity: 0.3,
189191
.shadowRadius: 5,

tests/unit/UIKitEquivalencyTests.swift

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ class UIKitEquivalencyTests: XCTestCase {
103103
.backgroundColor: UIColor.blue,
104104
.borderColor: UIColor.red,
105105
.opacity: 0.5,
106+
.shadowColor: UIColor.blue,
106107
]
107108
for (keyPath, value) in baselineProperties {
108109
rebuildView()

0 commit comments

Comments
 (0)