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

Commit 26d91bf

Browse files
author
Jeff Verkoeyen
committed
Merge branch 'release-candidate' into stable
2 parents 96c9e11 + 1aaa40e commit 26d91bf

File tree

7 files changed

+80
-8
lines changed

7 files changed

+80
-8
lines changed

.jazzy.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module: MotionInterchange
2+
module_version: 1.4.0
3+
sdk: iphonesimulator
4+
umbrella_header: src/MotionInterchange.h
5+
objc: true
6+
github_url: https://github.com/material-motion/motion-interchange-objc
7+
github_file_prefix: https://github.com/material-motion/motion-interchange-objc/tree/v1.4.0
8+

BUILD

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ strict_warnings_objc_library(
3333
"src/*.h",
3434
"src/private/*.h",
3535
]),
36+
sdk_frameworks = [
37+
"CoreGraphics",
38+
"Foundation",
39+
"QuartzCore",
40+
],
3641
enable_modules = 1,
3742
includes = ["src"],
3843
visibility = ["//visibility:public"],

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
# 1.4.0
2+
3+
This minor release introduces new APIs for creating springs that have an initial velocity.
4+
5+
## New features
6+
7+
Added new APIs for creating springs with initial velocity:
8+
`MDMMotionCurveMakeSpringWithInitialVelocity` and `_MDMSpringWithInitialVelocity`.
9+
10+
## Source changes
11+
12+
* [Add new APIs for creating springs with initial velocity. (#19)](https://github.com/material-motion/motion-interchange-objc/commit/326180f9f5f99e7d5e9e23131de8c24abe2e1dbf) (featherless)
13+
14+
## API changes
15+
16+
### MDMMotionCurveMakeSpringWithInitialVelocity
17+
18+
**new** function: `MDMMotionCurveMakeSpringWithInitialVelocity`
19+
20+
### _MDMSpringWithInitialVelocity
21+
22+
**new** macro: `_MDMSpringWithInitialVelocity`
23+
24+
## Non-source changes
25+
26+
* [Add sdk_frameworks dependencies to the BUILD file. (#18)](https://github.com/material-motion/motion-interchange-objc/commit/a601fb65166426bc708d84c0e29d89913c445d04) (featherless)
27+
* [Add jazzy yaml.](https://github.com/material-motion/motion-interchange-objc/commit/130e9760bbb8c0e2179f820cc14f1278c9465b84) (Jeff Verkoeyen)
28+
129
# 1.3.0
230

331
This minor releases introduces new APIs for defining motion curves.

MotionInterchange.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22
s.name = "MotionInterchange"
33
s.summary = "Motion interchange format."
4-
s.version = "1.3.0"
4+
s.version = "1.4.0"
55
s.authors = "The Material Motion Authors"
66
s.license = "Apache 2.0"
77
s.homepage = "https://github.com/material-motion/motion-interchange-objc"

Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PODS:
22
- CatalogByConvention (2.1.1)
3-
- MotionInterchange (1.3.0)
3+
- MotionInterchange (1.4.0)
44

55
DEPENDENCIES:
66
- CatalogByConvention
@@ -12,7 +12,7 @@ EXTERNAL SOURCES:
1212

1313
SPEC CHECKSUMS:
1414
CatalogByConvention: c3a5319de04250a7cd4649127fcfca5fe3322a43
15-
MotionInterchange: 988fc0011e4b806cc33f2fb4f9566f5eeb4159e8
15+
MotionInterchange: 35e0fd286ceab53dd4ee03494b3fcafa6a70637a
1616

1717
PODFILE CHECKSUM: 09090d12db5aab00a13fe82da94f338ebd03f5dc
1818

src/MDMMotionCurve.h

Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,21 @@ FOUNDATION_EXTERN MDMMotionCurve MDMMotionCurveMakeSpring(float mass, float tens
9494
NS_SWIFT_NAME(MotionCurveMakeSpring(mass:tension:friction:));
9595
// clang-format on
9696

97+
/**
98+
Creates a spring curve with the provided configuration.
99+
100+
Tension and friction map to Core Animation's stiffness and damping, respectively.
101+
102+
See the documentation for CASpringAnimation for more information.
103+
*/
104+
// clang-format off
105+
FOUNDATION_EXTERN MDMMotionCurve MDMMotionCurveMakeSpringWithInitialVelocity(float mass,
106+
float tension,
107+
float friction,
108+
float initialVelocity)
109+
NS_SWIFT_NAME(MotionCurveMakeSpring(mass:tension:friction:initialVelocity:));
110+
// clang-format on
111+
97112
/**
98113
For cubic bezier curves, returns a reversed cubic bezier curve. For all other curve types, a copy
99114
of the original curve is returned.
@@ -136,21 +151,30 @@ typedef NS_ENUM(NSUInteger, MDMSpringMotionCurveDataIndex) {
136151
// Objective-C-specific macros
137152

138153
#define _MDMBezier(p1x, p1y, p2x, p2y) \
139-
(MDMMotionCurve) { \
154+
((MDMMotionCurve) { \
140155
.type = MDMMotionCurveTypeBezier, \
141156
.data = { p1x, \
142157
p1y, \
143158
p2x, \
144159
p2y } \
145-
}
160+
})
146161

147162
#define _MDMSpring(mass, tension, friction) \
148-
(MDMMotionCurve) { \
163+
((MDMMotionCurve) { \
149164
.type = MDMMotionCurveTypeSpring, \
150165
.data = { mass, \
151166
tension, \
152167
friction } \
153-
}
168+
})
169+
170+
#define _MDMSpringWithInitialVelocity(mass, tension, friction, initialVelocity) \
171+
((MDMMotionCurve) { \
172+
.type = MDMMotionCurveTypeSpring, \
173+
.data = { mass, \
174+
tension, \
175+
friction, \
176+
initialVelocity } \
177+
})
154178

155179
/**
156180
A linear bezier motion curve.

src/MDMMotionCurve.m

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@ MDMMotionCurve MDMMotionCurveMakeBezier(float p1x, float p1y, float p2x, float p
2121
}
2222

2323
MDMMotionCurve MDMMotionCurveMakeSpring(float mass, float tension, float friction) {
24-
return _MDMSpring(mass, tension, friction);
24+
return MDMMotionCurveMakeSpringWithInitialVelocity(mass, tension, friction, 0);
25+
}
26+
27+
MDMMotionCurve MDMMotionCurveMakeSpringWithInitialVelocity(float mass,
28+
float tension,
29+
float friction,
30+
float initialVelocity) {
31+
return _MDMSpringWithInitialVelocity(mass, tension, friction, initialVelocity);
2532
}
2633

2734
MDMMotionCurve MDMMotionCurveFromTimingFunction(CAMediaTimingFunction *timingFunction) {

0 commit comments

Comments
 (0)