From 130e9760bbb8c0e2179f820cc14f1278c9465b84 Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Wed, 8 Nov 2017 15:37:44 -0500 Subject: [PATCH 1/6] Add jazzy yaml. --- .jazzy.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .jazzy.yaml diff --git a/.jazzy.yaml b/.jazzy.yaml new file mode 100644 index 0000000..6dfb630 --- /dev/null +++ b/.jazzy.yaml @@ -0,0 +1,8 @@ +module: MotionInterchange +module_version: 1.3.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.3.0 + From a601fb65166426bc708d84c0e29d89913c445d04 Mon Sep 17 00:00:00 2001 From: featherless Date: Thu, 9 Nov 2017 16:59:08 -0500 Subject: [PATCH 2/6] Add sdk_frameworks dependencies to the BUILD file. (#18) --- BUILD | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BUILD b/BUILD index 30ee3e5..1b38655 100644 --- a/BUILD +++ b/BUILD @@ -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"], From 326180f9f5f99e7d5e9e23131de8c24abe2e1dbf Mon Sep 17 00:00:00 2001 From: featherless Date: Fri, 10 Nov 2017 17:20:47 -0500 Subject: [PATCH 3/6] Add new APIs for creating springs with initial velocity. (#19) * Add new APIs for creating springs with initial velocity. * Wrapping parens. --- src/MDMMotionCurve.h | 32 ++++++++++++++++++++++++++++---- src/MDMMotionCurve.m | 9 ++++++++- 2 files changed, 36 insertions(+), 5 deletions(-) diff --git a/src/MDMMotionCurve.h b/src/MDMMotionCurve.h index 4aab196..dedeb85 100644 --- a/src/MDMMotionCurve.h +++ b/src/MDMMotionCurve.h @@ -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. @@ -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. diff --git a/src/MDMMotionCurve.m b/src/MDMMotionCurve.m index 7cb7b3c..828d100 100644 --- a/src/MDMMotionCurve.m +++ b/src/MDMMotionCurve.m @@ -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) { From 178b325fe41ac97b74c0a3ad740f65ea5a1b5206 Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Mon, 13 Nov 2017 10:11:58 -0500 Subject: [PATCH 4/6] Automatic changelog preparation for release. --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc8ed4d..539507a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# #develop# + + TODO: Enumerate changes. + + # 1.3.0 This minor releases introduces new APIs for defining motion curves. From a5cb24cc352fb4b1c9d150d268a5580de5f3364f Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Mon, 13 Nov 2017 10:14:55 -0500 Subject: [PATCH 5/6] Update changelog. --- CHANGELOG.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 539507a..b7357ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,30 @@ -# #develop# +# 1.4.0 - TODO: Enumerate changes. +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 From 1aaa40e07da47626f1d80db6e89dd1d089209c50 Mon Sep 17 00:00:00 2001 From: Jeff Verkoeyen Date: Mon, 13 Nov 2017 10:15:07 -0500 Subject: [PATCH 6/6] Bump the release. --- .jazzy.yaml | 4 ++-- MotionInterchange.podspec | 2 +- Podfile.lock | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.jazzy.yaml b/.jazzy.yaml index 6dfb630..fb3f97d 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -1,8 +1,8 @@ module: MotionInterchange -module_version: 1.3.0 +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.3.0 +github_file_prefix: https://github.com/material-motion/motion-interchange-objc/tree/v1.4.0 diff --git a/MotionInterchange.podspec b/MotionInterchange.podspec index ff98c90..b22cd8f 100644 --- a/MotionInterchange.podspec +++ b/MotionInterchange.podspec @@ -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" diff --git a/Podfile.lock b/Podfile.lock index 99c3b47..a5f15b2 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,6 +1,6 @@ PODS: - CatalogByConvention (2.1.1) - - MotionInterchange (1.3.0) + - MotionInterchange (1.4.0) DEPENDENCIES: - CatalogByConvention @@ -12,7 +12,7 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: CatalogByConvention: c3a5319de04250a7cd4649127fcfca5fe3322a43 - MotionInterchange: 988fc0011e4b806cc33f2fb4f9566f5eeb4159e8 + MotionInterchange: 35e0fd286ceab53dd4ee03494b3fcafa6a70637a PODFILE CHECKSUM: 09090d12db5aab00a13fe82da94f338ebd03f5dc