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

Commit 7710eca

Browse files
author
Jeff Verkoeyen
committed
Merge branch 'release-candidate' into stable
2 parents 0581bc3 + fb5b327 commit 7710eca

File tree

5 files changed

+24
-7
lines changed

5 files changed

+24
-7
lines changed

.jazzy.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module: MotionAnimator
2-
module_version: 4.0.0
2+
module_version: 4.0.1
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/v4.0.0
7+
github_file_prefix: https://github.com/material-motion/motion-animator-objc/tree/v4.0.1

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 4.0.1
2+
3+
This patch release fixes a bug on iOS 14 affecting flickers when using animations that have no delay.
4+
15
# 4.0.0
26

37
This major release drops official support for iOS 8 and fixes a static analyzer warning.

MotionAnimator.podspec

+1-1
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 = "4.0.0"
4+
s.version = "4.0.1"
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

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
PODS:
22
- CatalogByConvention (2.5.1)
3-
- MotionAnimator (4.0.0):
3+
- MotionAnimator (4.0.1):
44
- MotionInterchange (~> 3.0)
55
- MotionInterchange (3.0.0)
66

@@ -9,7 +9,7 @@ DEPENDENCIES:
99
- MotionAnimator (from `./`)
1010

1111
SPEC REPOS:
12-
https://github.com/cocoapods/specs.git:
12+
trunk:
1313
- CatalogByConvention
1414
- MotionInterchange
1515

@@ -19,9 +19,9 @@ EXTERNAL SOURCES:
1919

2020
SPEC CHECKSUMS:
2121
CatalogByConvention: 2b58a9b64e5b1049abb5d3f8e764a551bbe843a7
22-
MotionAnimator: 3a22c094f2a9c21c98cee9e69b6407d1e1fff654
22+
MotionAnimator: 5f99d7c9592928c0f28a66283eda9c3b657dc480
2323
MotionInterchange: 13adae439b377e31d1674cc165539d50e1d1566a
2424

2525
PODFILE CHECKSUM: 3537bf01c11174928ac008c20fec4738722e96f3
2626

27-
COCOAPODS: 1.6.0
27+
COCOAPODS: 1.9.3

src/MDMMotionAnimator.m

+13
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,21 @@ - (void)addAnimation:(CABasicAnimation *)animation
342342
animation.beginTime = ([layer convertTime:CACurrentMediaTime() fromLayer:nil]
343343
+ traits.delay * timeScaleFactor);
344344
animation.fillMode = kCAFillModeBackwards;
345+
} else if (@available(iOS 14, *)) {
346+
// iOS 14 introduced a behavioral change for animations such that they no longer appear to
347+
// immediately be committed to the render server, potentially resulting in a brief flicker to
348+
// the model layer's value before the animation takes effect. This could reasonably be
349+
// considered a bug in iOS.
350+
// To work around this, we can explicitly enforce the contract that this animation is expected
351+
// to start "now" in terms of render server timing. This does mean we may lose some microseconds
352+
// of animation timing at the beginning of the animation, so we only apply this on iOS 14+ where
353+
// it's needed. If and when iOS fixes this bug we can remove the following line and lean on the
354+
// render server choosing the appropriate start time once the animation is flushed to the render
355+
// server.
356+
animation.beginTime = [layer convertTime:CACurrentMediaTime() fromLayer:nil];
345357
}
346358

359+
347360
[_registrar addAnimation:animation toLayer:layer forKey:key completion:completion];
348361
}
349362

0 commit comments

Comments
 (0)