Skip to content

Commit

Permalink
Move comment on default spring animation to helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
kkafar committed Nov 4, 2024
1 parent 0e1f818 commit 81fe5ed
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ios/RNSScreenStackAnimator.mm
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,6 @@ - (void)animateSimplePushWithShadowEnabled:(BOOL)shadowEnabled
shadowView.alpha = 0.0;
}

// Default curve provider is as defined below, however spring timing defined this way
// ignores the requested duration of the animation, effectively impairing our `animationDuration` prop.
// Damping of 1.0 seems close enough and we keep `animationDuration` functional.
// id<UITimingCurveProvider> timingCurveProvider = [[UISpringTimingParameters alloc] init];

UIViewPropertyAnimator *animator =
[[UIViewPropertyAnimator alloc] initWithDuration:[self transitionDuration:transitionContext]
timingParameters:[RNSScreenStackAnimator defaultSpringTimingParametersApprox]];
Expand Down Expand Up @@ -515,6 +510,11 @@ - (void)animateTransitionWithStackAnimation:(RNSScreenStackAnimation)animation

+ (UISpringTimingParameters *)defaultSpringTimingParametersApprox
{
// Default curve provider is as defined below, however spring timing defined this way
// ignores the requested duration of the animation, effectively impairing our `animationDuration` prop.
// Damping of 1.0 seems close enough and we keep `animationDuration` functional.
// id<UITimingCurveProvider> timingCurveProvider = [[UISpringTimingParameters alloc] init];

return [[UISpringTimingParameters alloc] initWithDampingRatio:1.0];
}

Expand Down

0 comments on commit 81fe5ed

Please sign in to comment.