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

Commit 8fa1f1d

Browse files
author
Jeff Verkoeyen
committed
Merge branch 'release-candidate' into stable
2 parents 6d13fe8 + 9a5d0f9 commit 8fa1f1d

File tree

13 files changed

+230
-42
lines changed

13 files changed

+230
-42
lines changed

.jazzy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module: MotionAnimator
2-
module_version: 2.3.0
2+
module_version: 2.4.0
33
sdk: iphonesimulator
44
umbrella_header: src/MotionAnimator.h
55
objc: true
66
github_url: https://github.com/material-motion/motion-animator-objc
7-
github_file_prefix: https://github.com/material-motion/motion-animator-objc/tree/v2.3.0
7+
github_file_prefix: https://github.com/material-motion/motion-animator-objc/tree/v2.4.0

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
# 2.4.0
2+
3+
This minor release introduces support for implicitly animating CALayers that have been created
4+
independently of a UIView. To use this new functionality, consider the following example:
5+
6+
```swift
7+
let layer = CALayer()
8+
layer.delegate = MotionAnimator.sharedLayerDelegate()
9+
animator.animate(with: timing) {
10+
layer.opacity = 0.5
11+
}
12+
```
13+
14+
## New features
15+
16+
Added support for adding implicit animations to headless CALayer instances.
17+
18+
## Source changes
19+
20+
* [Add support for headless implicit layer animations. (#45)](https://github.com/material-motion/motion-animator-objc/commit/b92bb0a26c3458b508e0ba85628aea3e1590df28) (featherless)
21+
22+
## API changes
23+
24+
### MDMAnimator
25+
26+
**new** method: `+sharedLayerDelegate`
27+
28+
## Non-source changes
29+
30+
* [Remove references to interchange macros. (#44)](https://github.com/material-motion/motion-animator-objc/commit/a1c771b781713d6fc63e68ede73690e1f16c9624) (featherless)
31+
* [Add missing Info.plist. (#43)](https://github.com/material-motion/motion-animator-objc/commit/41fa66f904b28058f5a968da879749d3732d6c35) (Sylvain Defresne)
32+
133
# 2.3.0
234

335
This minor release introduces new features for working with gestural interactions.

MotionAnimator.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 = "MotionAnimator"
33
s.summary = "A Motion Animator creates performant, interruptible animations from motion specs."
4-
s.version = "2.3.0"
4+
s.version = "2.4.0"
55
s.authors = "The Material Motion Authors"
66
s.license = "Apache 2.0"
77
s.homepage = "https://github.com/material-motion/motion-animator-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.2.0)
3-
- MotionAnimator (2.3.0):
3+
- MotionAnimator (2.4.0):
44
- MotionInterchange (~> 1.3)
55
- MotionInterchange (1.3.0)
66

@@ -14,7 +14,7 @@ EXTERNAL SOURCES:
1414

1515
SPEC CHECKSUMS:
1616
CatalogByConvention: 5df5831e48b8083b18570dcb804f20fd1c90694f
17-
MotionAnimator: 133a697ee8c7e07f96553f641571bdb6ef698cb2
17+
MotionAnimator: 640dc3e652080bd05251e5ffe32b41f16bfaa3e1
1818
MotionInterchange: 988fc0011e4b806cc33f2fb4f9566f5eeb4159e8
1919

2020
PODFILE CHECKSUM: 3537bf01c11174928ac008c20fec4738722e96f3

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -171,23 +171,23 @@ view.center = before;
171171
Now let's say we wrote the same code with a motion spec and animator:
172172
173173
```objc
174-
static const MDMMotionTiming kMotionSpec = {
175-
.duration = 0.5, .curve = _MDMSpring(1, 100, 1),
174+
MDMMotionTiming motionSpec = {
175+
.duration = 0.5, .curve = MDMMotionCurveMakeSpring(1, 100, 1),
176176
};
177177
178178
MDMMotionAnimator *animator = [[MDMMotionAnimator alloc] init];
179179
animator.shouldReverseValues = dismissing;
180180
view.center = offscreen;
181181
[_animator animateWithTiming:kMotionSpec animations:^{
182182
view.center = onscreen;
183-
}]
183+
}];
184184
```
185185

186186
Now if we want to change our motion back to an easing curve, we only have to change the spec:
187187

188188
```objc
189-
static const MDMMotionTiming kMotionSpec = {
190-
.duration = 0.5, .curve = _MDMBezier(0.4f, 0.0f, 0.2f, 1.0f),
189+
MDMMotionTiming motionSpec = {
190+
.duration = 0.5, .curve = MDMMotionCurveMakeBezier(0.4f, 0.0f, 0.2f, 1.0f),
191191
};
192192
```
193193

examples/CalendarCardExpansionExample.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ @implementation CalendarCardExpansionExampleViewController {
4040
- (void)didTap {
4141
_expanded = !_expanded;
4242

43-
CalendarChipTiming timing = _expanded ? CalendarChipSpec.expansion : CalendarChipSpec.collapse;
43+
CalendarChipTiming timing = (_expanded
44+
? CalendarChipMotionSpec.expansion
45+
: CalendarChipMotionSpec.collapse);
4446

4547
MDMMotionAnimator *animator = [[MDMMotionAnimator alloc] init];
4648
animator.shouldReverseValues = !_expanded;

examples/CalendarChipMotionSpec.h

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#import <Foundation/Foundation.h>
1818
#import <MotionInterchange/MotionInterchange.h>
1919

20-
struct CalendarChipTiming {
20+
typedef struct CalendarChipTiming {
2121
MDMMotionTiming chipWidth;
2222
MDMMotionTiming chipHeight;
2323
MDMMotionTiming chipY;
@@ -26,13 +26,15 @@ struct CalendarChipTiming {
2626
MDMMotionTiming headerContentOpacity;
2727

2828
MDMMotionTiming navigationBarY;
29-
};
30-
typedef struct CalendarChipTiming CalendarChipTiming;
29+
} CalendarChipTiming;
3130

32-
struct CalendarChipMotionSpec {
33-
CalendarChipTiming expansion;
34-
CalendarChipTiming collapse;
35-
};
36-
typedef struct CalendarChipMotionSpec CalendarChipMotionSpec;
31+
@interface CalendarChipMotionSpec: NSObject
32+
33+
@property(nonatomic, class, readonly) CalendarChipTiming expansion;
34+
@property(nonatomic, class, readonly) CalendarChipTiming collapse;
35+
36+
// This object is not meant to be instantiated.
37+
- (instancetype)init NS_UNAVAILABLE;
38+
39+
@end
3740

38-
FOUNDATION_EXTERN struct CalendarChipMotionSpec CalendarChipSpec;

examples/CalendarChipMotionSpec.m

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,51 +16,59 @@
1616

1717
#import "CalendarChipMotionSpec.h"
1818

19-
#define MDMEightyForty _MDMBezier(0.4f, 0.0f, 0.2f, 1.0f)
20-
#define MDMFortyOut _MDMBezier(0.4f, 0.0f, 1.0f, 1.0f)
21-
#define MDMEightyIn _MDMBezier(0.0f, 0.0f, 0.2f, 1.0f)
22-
#define MDMLinear _MDMBezier(0.0f, 0.0f, 1.0f, 1.0f)
19+
@implementation CalendarChipMotionSpec
2320

24-
struct CalendarChipMotionSpec CalendarChipSpec = {
25-
.expansion = {
21+
+ (MDMMotionCurve)eightyForty {
22+
return MDMMotionCurveMakeBezier(0.4f, 0.0f, 0.2f, 1.0f);
23+
}
24+
25+
+ (CalendarChipTiming)expansion {
26+
MDMMotionCurve eightyForty = [self eightyForty];
27+
return (CalendarChipTiming){
2628
.chipWidth = {
27-
.delay = 0.000, .duration = 0.285, .curve = MDMEightyForty,
29+
.delay = 0.000, .duration = 0.285, .curve = eightyForty,
2830
},
2931
.chipHeight = {
30-
.delay = 0.015, .duration = 0.360, .curve = MDMEightyForty,
32+
.delay = 0.015, .duration = 0.360, .curve = eightyForty,
3133
},
3234
.chipY = {
33-
.delay = 0.015, .duration = 0.360, .curve = MDMEightyForty,
35+
.delay = 0.015, .duration = 0.360, .curve = eightyForty,
3436
},
3537
.chipContentOpacity = {
36-
.delay = 0.000, .duration = 0.075, .curve = MDMLinear,
38+
.delay = 0.000, .duration = 0.075, .curve = MDMLinearMotionCurve,
3739
},
3840
.headerContentOpacity = {
39-
.delay = 0.075, .duration = 0.150, .curve = MDMLinear,
41+
.delay = 0.075, .duration = 0.150, .curve = MDMLinearMotionCurve,
4042
},
4143
.navigationBarY = {
42-
.delay = 0.015, .duration = 0.360, .curve = MDMEightyForty,
44+
.delay = 0.015, .duration = 0.360, .curve = eightyForty,
4345
},
44-
},
45-
.collapse = {
46+
};
47+
}
48+
49+
+ (CalendarChipTiming)collapse {
50+
MDMMotionCurve eightyForty = [self eightyForty];
51+
return (CalendarChipTiming){
4652
.chipWidth = {
47-
.delay = 0.045, .duration = 0.330, .curve = MDMEightyForty,
53+
.delay = 0.045, .duration = 0.330, .curve = eightyForty,
4854
},
4955
.chipHeight = {
50-
.delay = 0.000, .duration = 0.330, .curve = MDMEightyForty,
56+
.delay = 0.000, .duration = 0.330, .curve = eightyForty,
5157
},
5258
.chipY = {
53-
.delay = 0.015, .duration = 0.330, .curve = MDMEightyForty,
59+
.delay = 0.015, .duration = 0.330, .curve = eightyForty,
5460
},
5561
.chipContentOpacity = {
56-
.delay = 0.150, .duration = 0.150, .curve = MDMLinear,
62+
.delay = 0.150, .duration = 0.150, .curve = MDMLinearMotionCurve,
5763
},
5864
.headerContentOpacity = {
59-
.delay = 0.000, .duration = 0.075, .curve = MDMLinear,
65+
.delay = 0.000, .duration = 0.075, .curve = MDMLinearMotionCurve,
6066
},
6167
.navigationBarY = {
62-
.delay = 0.045, .duration = 0.150, .curve = MDMEightyForty,
68+
.delay = 0.045, .duration = 0.150, .curve = eightyForty,
6369
}
64-
},
65-
};
70+
};
71+
}
72+
73+
@end
6674

examples/apps/Catalog/MotionAnimatorCatalog.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
66BF5A8F1FB0E4CB00E864F6 /* ImplicitAnimationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66BF5A8E1FB0E4CB00E864F6 /* ImplicitAnimationTests.swift */; };
2323
66DD4BF51EEF0ECB00207119 /* CalendarCardExpansionExample.m in Sources */ = {isa = PBXBuildFile; fileRef = 66DD4BF41EEF0ECB00207119 /* CalendarCardExpansionExample.m */; };
2424
66DD4BF81EEF1C4B00207119 /* CalendarChipMotionSpec.m in Sources */ = {isa = PBXBuildFile; fileRef = 66DD4BF71EEF1C4B00207119 /* CalendarChipMotionSpec.m */; };
25+
66EF6F281FC33C4800C83A63 /* HeadlessLayerImplicitAnimationTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 66EF6F271FC33C4800C83A63 /* HeadlessLayerImplicitAnimationTests.swift */; };
2526
66FD99FA1EE9FBBE00C53A82 /* MotionAnimatorTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 66FD99F91EE9FBBE00C53A82 /* MotionAnimatorTests.m */; };
2627
FCA09739CCE089F0D051AA87 /* Pods_MotionAnimatorCatalog.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 50D808A6F9E944D54276D32F /* Pods_MotionAnimatorCatalog.framework */; };
2728
/* End PBXBuildFile section */
@@ -69,6 +70,7 @@
6970
66DD4BF41EEF0ECB00207119 /* CalendarCardExpansionExample.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CalendarCardExpansionExample.m; sourceTree = "<group>"; };
7071
66DD4BF61EEF1C4B00207119 /* CalendarChipMotionSpec.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CalendarChipMotionSpec.h; sourceTree = "<group>"; };
7172
66DD4BF71EEF1C4B00207119 /* CalendarChipMotionSpec.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CalendarChipMotionSpec.m; sourceTree = "<group>"; };
73+
66EF6F271FC33C4800C83A63 /* HeadlessLayerImplicitAnimationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeadlessLayerImplicitAnimationTests.swift; sourceTree = "<group>"; };
7274
66FD99F91EE9FBBE00C53A82 /* MotionAnimatorTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MotionAnimatorTests.m; sourceTree = "<group>"; };
7375
6EB4A3E0A8428C89A9BE95EE /* Pods-MotionAnimatorCatalog.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MotionAnimatorCatalog.release.xcconfig"; path = "../../../Pods/Target Support Files/Pods-MotionAnimatorCatalog/Pods-MotionAnimatorCatalog.release.xcconfig"; sourceTree = "<group>"; };
7476
9DE90426033EDF40C65232A9 /* Pods-UnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-UnitTests.debug.xcconfig"; path = "../../../Pods/Target Support Files/Pods-UnitTests/Pods-UnitTests.debug.xcconfig"; sourceTree = "<group>"; };
@@ -211,6 +213,7 @@
211213
isa = PBXGroup;
212214
children = (
213215
66A6A6671FBA158000DE54CB /* AnimationRemovalTests.swift */,
216+
66EF6F271FC33C4800C83A63 /* HeadlessLayerImplicitAnimationTests.swift */,
214217
66FD99F91EE9FBBE00C53A82 /* MotionAnimatorTests.m */,
215218
668726491EF04B4C00113675 /* MotionAnimatorTests.swift */,
216219
66BF5A8E1FB0E4CB00E864F6 /* ImplicitAnimationTests.swift */,
@@ -492,6 +495,7 @@
492495
buildActionMask = 2147483647;
493496
files = (
494497
6625876C1FB4DB9C00BC7DF1 /* InitialVelocityTests.swift in Sources */,
498+
66EF6F281FC33C4800C83A63 /* HeadlessLayerImplicitAnimationTests.swift in Sources */,
495499
660636021FACC24300C3DFB8 /* TimeScaleFactorTests.swift in Sources */,
496500
66BF5A8F1FB0E4CB00E864F6 /* ImplicitAnimationTests.swift in Sources */,
497501
66A6A6681FBA158000DE54CB /* AnimationRemovalTests.swift in Sources */,

resources/Info.plist

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>FMWK</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0.2</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>$(CURRENT_PROJECT_VERSION)</string>
23+
<key>NSPrincipalClass</key>
24+
<string></string>
25+
</dict>
26+
</plist>

0 commit comments

Comments
 (0)