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

Commit e720f9f

Browse files
authored
Disable partial availability warning for CASpringAnimation. (#12)
* Disable partial availability warning for CASpringAnimation. * Docs.
1 parent 4a70beb commit e720f9f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/MDMMotionAnimator.m

+7
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,17 @@ - (void)addCoreAnimationTracer:(void (^)(CALayer *, CAAnimation *))tracer {
177177
break;
178178

179179
case MDMMotionCurveTypeSpring: {
180+
#pragma clang diagnostic push
181+
// CASpringAnimation is a private API on iOS 8 - we're able to make use of it because we're
182+
// linking against the public API on iOS 9+.
183+
#pragma clang diagnostic ignored "-Wpartial-availability"
180184
CASpringAnimation *spring = [CASpringAnimation animation];
185+
#pragma clang diagnostic pop
181186
spring.mass = timing.curve.data[MDMSpringMotionCurveDataIndexMass];
182187
spring.stiffness = timing.curve.data[MDMSpringMotionCurveDataIndexTension];
183188
spring.damping = timing.curve.data[MDMSpringMotionCurveDataIndexFriction];
189+
190+
// This API is only available on iOS 9+
184191
if ([spring respondsToSelector:@selector(settlingDuration)]) {
185192
spring.duration = spring.settlingDuration;
186193
} else {

0 commit comments

Comments
 (0)