Open winkelsdorf opened 10 years ago
As of now a workaround:
#pragma mark - SIAlterView Private Property Access
@interface SIAlertView ()
@property (nonatomic, strong) UIView *containerView;
@end
...
// before show, after creating the SIAlertView instance and setting the buttons etc:
UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismissQuickAccess:)];
tapRecognizer.cancelsTouchesInView = NO;
[quickAccessView addGestureRecognizer:tapRecognizer];
[quickAccessView show];
and Tap Handling as the following:
- (void)dismissQuickAccess:(UITapGestureRecognizer *)gestureRecognizer
{
// dismiss Quick Access when touching outside of it
CGPoint point = [gestureRecognizer locationInView:self.view];
if (!CGRectContainsPoint(quickAccessView.containerView.frame, point))
{
[quickAccessView dismissAnimated:YES];
}
}
quickAccessView is just a private declaration for an SIAlertView:
SIAlertView *quickAccessView;
Cheers
Need this feature!
I've added a pull request with this update https://github.com/Sumi-Interactive/SIAlertView/pull/129
Enhancement req. as in the title.
Let the user close the SIAlertView by touching/clicking outside the SIAlertView UIView.