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

Commit

Permalink
Merge branch 'release-candidate' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Verkoeyen committed Nov 13, 2017
2 parents 96c9e11 + 1aaa40e commit 26d91bf
Show file tree
Hide file tree
Showing 7 changed files with 80 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .jazzy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module: MotionInterchange
module_version: 1.4.0
sdk: iphonesimulator
umbrella_header: src/MotionInterchange.h
objc: true
github_url: https://github.com/material-motion/motion-interchange-objc
github_file_prefix: https://github.com/material-motion/motion-interchange-objc/tree/v1.4.0

5 changes: 5 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ strict_warnings_objc_library(
"src/*.h",
"src/private/*.h",
]),
sdk_frameworks = [
"CoreGraphics",
"Foundation",
"QuartzCore",
],
enable_modules = 1,
includes = ["src"],
visibility = ["//visibility:public"],
Expand Down
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
# 1.4.0

This minor release introduces new APIs for creating springs that have an initial velocity.

## New features

Added new APIs for creating springs with initial velocity:
`MDMMotionCurveMakeSpringWithInitialVelocity` and `_MDMSpringWithInitialVelocity`.

## Source changes

* [Add new APIs for creating springs with initial velocity. (#19)](https://github.com/material-motion/motion-interchange-objc/commit/326180f9f5f99e7d5e9e23131de8c24abe2e1dbf) (featherless)

## API changes

### MDMMotionCurveMakeSpringWithInitialVelocity

**new** function: `MDMMotionCurveMakeSpringWithInitialVelocity`

### _MDMSpringWithInitialVelocity

**new** macro: `_MDMSpringWithInitialVelocity`

## Non-source changes

* [Add sdk_frameworks dependencies to the BUILD file. (#18)](https://github.com/material-motion/motion-interchange-objc/commit/a601fb65166426bc708d84c0e29d89913c445d04) (featherless)
* [Add jazzy yaml.](https://github.com/material-motion/motion-interchange-objc/commit/130e9760bbb8c0e2179f820cc14f1278c9465b84) (Jeff Verkoeyen)

# 1.3.0

This minor releases introduces new APIs for defining motion curves.
Expand Down
2 changes: 1 addition & 1 deletion MotionInterchange.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|
s.name = "MotionInterchange"
s.summary = "Motion interchange format."
s.version = "1.3.0"
s.version = "1.4.0"
s.authors = "The Material Motion Authors"
s.license = "Apache 2.0"
s.homepage = "https://github.com/material-motion/motion-interchange-objc"
Expand Down
4 changes: 2 additions & 2 deletions Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- CatalogByConvention (2.1.1)
- MotionInterchange (1.3.0)
- MotionInterchange (1.4.0)

DEPENDENCIES:
- CatalogByConvention
Expand All @@ -12,7 +12,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
CatalogByConvention: c3a5319de04250a7cd4649127fcfca5fe3322a43
MotionInterchange: 988fc0011e4b806cc33f2fb4f9566f5eeb4159e8
MotionInterchange: 35e0fd286ceab53dd4ee03494b3fcafa6a70637a

PODFILE CHECKSUM: 09090d12db5aab00a13fe82da94f338ebd03f5dc

Expand Down
32 changes: 28 additions & 4 deletions src/MDMMotionCurve.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ FOUNDATION_EXTERN MDMMotionCurve MDMMotionCurveMakeSpring(float mass, float tens
NS_SWIFT_NAME(MotionCurveMakeSpring(mass:tension:friction:));
// clang-format on

/**
Creates a spring curve with the provided configuration.
Tension and friction map to Core Animation's stiffness and damping, respectively.
See the documentation for CASpringAnimation for more information.
*/
// clang-format off
FOUNDATION_EXTERN MDMMotionCurve MDMMotionCurveMakeSpringWithInitialVelocity(float mass,
float tension,
float friction,
float initialVelocity)
NS_SWIFT_NAME(MotionCurveMakeSpring(mass:tension:friction:initialVelocity:));
// clang-format on

/**
For cubic bezier curves, returns a reversed cubic bezier curve. For all other curve types, a copy
of the original curve is returned.
Expand Down Expand Up @@ -136,21 +151,30 @@ typedef NS_ENUM(NSUInteger, MDMSpringMotionCurveDataIndex) {
// Objective-C-specific macros

#define _MDMBezier(p1x, p1y, p2x, p2y) \
(MDMMotionCurve) { \
((MDMMotionCurve) { \
.type = MDMMotionCurveTypeBezier, \
.data = { p1x, \
p1y, \
p2x, \
p2y } \
}
})

#define _MDMSpring(mass, tension, friction) \
(MDMMotionCurve) { \
((MDMMotionCurve) { \
.type = MDMMotionCurveTypeSpring, \
.data = { mass, \
tension, \
friction } \
}
})

#define _MDMSpringWithInitialVelocity(mass, tension, friction, initialVelocity) \
((MDMMotionCurve) { \
.type = MDMMotionCurveTypeSpring, \
.data = { mass, \
tension, \
friction, \
initialVelocity } \
})

/**
A linear bezier motion curve.
Expand Down
9 changes: 8 additions & 1 deletion src/MDMMotionCurve.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,14 @@ MDMMotionCurve MDMMotionCurveMakeBezier(float p1x, float p1y, float p2x, float p
}

MDMMotionCurve MDMMotionCurveMakeSpring(float mass, float tension, float friction) {
return _MDMSpring(mass, tension, friction);
return MDMMotionCurveMakeSpringWithInitialVelocity(mass, tension, friction, 0);
}

MDMMotionCurve MDMMotionCurveMakeSpringWithInitialVelocity(float mass,
float tension,
float friction,
float initialVelocity) {
return _MDMSpringWithInitialVelocity(mass, tension, friction, initialVelocity);
}

MDMMotionCurve MDMMotionCurveFromTimingFunction(CAMediaTimingFunction *timingFunction) {
Expand Down

0 comments on commit 26d91bf

Please sign in to comment.