Skip to content

Commit

Permalink
Merge pull request #13 from mrichie/master
Browse files Browse the repository at this point in the history
prevent multiple Toast overlaps in iOS - testing it now
  • Loading branch information
EddyVerbruggen committed Aug 14, 2014
2 parents e6c1c89 + 654dccb commit 218832b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ios/Toast+UIView.m
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
static const NSString * CSToastTimerKey = @"CSToastTimerKey";
static const NSString * CSToastActivityViewKey = @"CSToastActivityViewKey";

static UIView *prevToast = NULL;

@interface UIView (ToastPrivate)

- (void)hideToast:(UIView *)toast;
Expand Down Expand Up @@ -91,6 +93,10 @@ - (void)showToast:(UIView *)toast {
}

- (void)showToast:(UIView *)toast duration:(NSTimeInterval)duration position:(id)point {
if(prevToast){
[self hideToast:prevToast];
}
prevToast = toast;
toast.center = [self centerPointForPosition:point withToast:toast];
toast.alpha = 0.0;

Expand Down

0 comments on commit 218832b

Please sign in to comment.