Skip to content

Commit

Permalink
Fixed a bug in a gesture recognizer.
Browse files Browse the repository at this point in the history
  • Loading branch information
jivadevoe committed Jun 26, 2013
1 parent bd110fe commit 73ba55c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions UIViewController+Slick.m
Expand Up @@ -76,6 +76,16 @@ -(void)slick_darkDismiss:(id)sender;
{
id<SlickViewControllerDelegate> delegate = objc_getAssociatedObject(self, @"com.random-ideas.DELEGATE");
UIViewController *controller = objc_getAssociatedObject(self, @"com.random-ideas.FLIPPED_CONTROLLER");

if([sender isKindOfClass:[UIGestureRecognizer class]])
{
UIGestureRecognizer *rec = (UIGestureRecognizer *)sender;
UIView *darkenView = objc_getAssociatedObject(self, @"com.random-ideas.DARKENED_VIEW");
if(CGRectContainsPoint(controller.view.frame, [rec locationInView:darkenView]))
{
return;
}
}

if([delegate respondsToSelector:@selector(slickViewControllerCanDismiss:)])
{
Expand Down Expand Up @@ -132,6 +142,7 @@ -(void)presentModalViewControllerWithSlickZoomAnimation:(UIViewController *)inMo
UIView *darkenView = [[UIView alloc] initWithFrame:parentFrame];
//darkenView.center = parentView.boundsCenter;
UIGestureRecognizer *rec = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(slick_darkDismiss:)];
rec.cancelsTouchesInView = NO;
[darkenView addGestureRecognizer:rec];

[darkenView setBackgroundColor:[UIColor blackColor]];
Expand Down

0 comments on commit 73ba55c

Please sign in to comment.