diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e54b87..ce2c4ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.5.1 + +- Fix default animation values + ## 1.5.0 - Feature: Add predefined and configurable easing functions to the API. Swipe animations are now splitted into different settings so you can now use different animations (easing function, duration, etc) for each kind of animations: show swipe, hide swipe, stretch cell from already swiped buttons and more. diff --git a/MGSwipeTableCell.podspec b/MGSwipeTableCell.podspec index 22fe870..a3a5131 100644 --- a/MGSwipeTableCell.podspec +++ b/MGSwipeTableCell.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'MGSwipeTableCell' - s.version = '1.5.0' + s.version = '1.5.1' s.author = { 'Imanol Fernandez' => 'mortimergoro@gmail.com' } s.homepage = 'https://github.com/MortimerGoro/MGSwipeTableCell' s.summary = 'An easy to use UITableViewCell subclass that allows to display swipeable buttons with a variety of transitions' diff --git a/MGSwipeTableCell/MGSwipeTableCell.m b/MGSwipeTableCell/MGSwipeTableCell.m index 5e90586..d656833 100644 --- a/MGSwipeTableCell/MGSwipeTableCell.m +++ b/MGSwipeTableCell/MGSwipeTableCell.m @@ -484,20 +484,11 @@ static inline CGFloat mgEaseInOutBounce(CGFloat t, CGFloat b, CGFloat c) { return mgEaseOutBounce (1.0 - t*2, 0, c) * .5 + c*.5 + b; }; -static inline CGFloat mgEaseOutElastic(CGFloat t, CGFloat b, CGFloat c) { - CGFloat s=1.70158;CGFloat p=0;CGFloat a=c; CGFloat d = 0.6; - if (t==0) return b; if (t==1) return b+c; if (!p) p=d*.3; - if (a < fabs(c)) { a=c; s=p/4; } - else s = p/(2*M_PI) * asin(c/a); - return a*pow(2,-10*t) * sin( (t*d-s)*(2*M_PI)/p ) + c + b; -} - - @implementation MGSwipeAnimation -(instancetype) init { if (self = [super init]) { - _duration = 0.6; + _duration = 0.3; _easingFunction = MGSwipeEasingFunctionCubicOut; } return self; @@ -523,7 +514,6 @@ -(CGFloat) value:(CGFloat)elapsed duration:(CGFloat)duration from:(CGFloat)from case MGSwipeEasingFunctionBounceOut: easingFunction = mgEaseOutBounce;break; case MGSwipeEasingFunctionBounceInOut: easingFunction = mgEaseInOutBounce;break; } - easingFunction = mgEaseOutBounce; return (*easingFunction)(t, from, to - from); }