Skip to content
This repository has been archived by the owner on Oct 30, 2020. It is now read-only.

Commit

Permalink
[1.0.1]
Browse files Browse the repository at this point in the history
• Updated animation durations
  • Loading branch information
JonasGessner committed Aug 2, 2014
1 parent d6f20de commit 227a064
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions JGActionSheet/JGActionSheet.m
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
#define kFixedWidth 320.0f
#define kFixedWidthContinuous 300.0f

#define kAnimationDurationForSectionCount(count) MAX(0.22f, MIN(count*0.12f, 0.45f))

#pragma mark - Helpers

NS_INLINE UIBezierPath *trianglePath(CGRect rect, JGActionSheetArrowDirection arrowDirection, BOOL closePath) {
Expand Down Expand Up @@ -716,7 +718,7 @@ - (void)showInView:(UIView *)view animated:(BOOL)animated {
completion();
}
else {
CGFloat duration = MAX(0.2f, MIN(self.sections.count*0.15f, 0.5f));
CGFloat duration = (iPad ? 0.3f : kAnimationDurationForSectionCount(self.sections.count));

[UIView animateWithDuration:duration animations:^{
[self layoutForVisible:YES];
Expand Down Expand Up @@ -970,11 +972,11 @@ - (void)dismissAnimated:(BOOL)animated {
if (animated) {
CGFloat duration = 0.0f;

if (_anchoredAtPoint) {
if (iPad) {
duration = 0.3f;
}
else {
duration = MAX(0.2f, MIN(self.sections.count*0.15f, 0.5f));
duration = kAnimationDurationForSectionCount(self.sections.count);
}

[UIView animateWithDuration:duration animations:^{
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A feature rich and modern action sheet for iOS.
<img src="JGActionSheet%20Tests/Screenshots/1.png" width="36.2%"/>&nbsp;
<img src="JGActionSheet%20Tests/Screenshots/2.png" width="48%"/></p>

#####Current Version: 1.0
#####Current Version: 1.0.1

Introduction
===========
Expand Down

0 comments on commit 227a064

Please sign in to comment.