@@ -293,26 +293,26 @@ - (void)showActionSheetPicker {
293
293
switch (self.tapDismissAction ) {
294
294
case TapActionDismiss: {
295
295
// add tap dismiss action
296
- self.actionSheet .window .userInteractionEnabled = YES ;
296
+ self.actionSheet .superview .userInteractionEnabled = YES ;
297
297
UITapGestureRecognizer *tapAction = [[UITapGestureRecognizer alloc ] initWithTarget: self action: @selector (dismissPicker )];
298
298
tapAction.delegate = self;
299
- [self .actionSheet.window addGestureRecognizer: tapAction];
299
+ [self .actionSheet.superview addGestureRecognizer: tapAction];
300
300
break ;
301
301
}
302
302
case TapActionSuccess: {
303
303
// add tap success action with dismissPicker
304
- self.actionSheet .window .userInteractionEnabled = YES ;
304
+ self.actionSheet .superview .userInteractionEnabled = YES ;
305
305
UITapGestureRecognizer *tapAction = [[UITapGestureRecognizer alloc ] initWithTarget: self action: @selector (actionPickerDone: )];
306
306
tapAction.delegate = self;
307
- [self .actionSheet.window addGestureRecognizer: tapAction];
307
+ [self .actionSheet.superview addGestureRecognizer: tapAction];
308
308
break ;
309
309
}
310
310
case TapActionCancel: {
311
311
// add tap cancel action with dismissPicker
312
- self.actionSheet .window .userInteractionEnabled = YES ;
312
+ self.actionSheet .superview .userInteractionEnabled = YES ;
313
313
UITapGestureRecognizer *tapAction = [[UITapGestureRecognizer alloc ] initWithTarget: self action: @selector (actionPickerCancel: )];
314
314
tapAction.delegate = self;
315
- [self .actionSheet.window addGestureRecognizer: tapAction];
315
+ [self .actionSheet.superview addGestureRecognizer: tapAction];
316
316
break ;
317
317
}
318
318
};
@@ -798,8 +798,9 @@ - (void)presentPopover:(UIViewController *)viewController {
798
798
#pragma mark UIGestureRecognizerDelegate
799
799
800
800
- (BOOL )gestureRecognizerShouldBegin : (UIGestureRecognizer *)gestureRecognizer {
801
- CGPoint location = [gestureRecognizer locationInView: self .toolbar];
802
- return !CGRectContainsPoint (self.toolbar .bounds , location);
801
+ CGPoint toolbarLocation = [gestureRecognizer locationInView: self .toolbar];
802
+ CGPoint actionSheetLocation = [gestureRecognizer locationInView: self .actionSheet];
803
+ return !(CGRectContainsPoint (self.toolbar .bounds , toolbarLocation) || CGRectContainsPoint (self.actionSheet .bgView .frame , actionSheetLocation));
803
804
}
804
805
805
806
@end
0 commit comments