File tree Expand file tree Collapse file tree 3 files changed +9
-7
lines changed
Leanplum-SDK/Classes/MessageTemplates Expand file tree Collapse file tree 3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -65,19 +65,20 @@ - (void)viewDidLoad
6565 [self .dismissButton setHidden: YES ];
6666 }
6767
68- // passthrough view to send touch events to underlaying ViewController
69- LPHitView* passthroughView = (LPHitView *) self.view ;
70- if (passthroughView) {
71- passthroughView.touchDelegate = self.presentingViewController .view ;
72- }
73-
7468 // add gesture recognizer to close message if tap outside to close is set to true.
7569 BOOL tapOutside = [self .context boolNamed: LPMT_ARG_HTML_TAP_OUTSIDE_TO_CLOSE];
7670 if (tapOutside) {
7771 UITapGestureRecognizer* gestureRecognizer = [[UITapGestureRecognizer alloc ] initWithTarget: self action: @selector (didTapOutside )];
7872 [self .view addGestureRecognizer: gestureRecognizer];
7973 }
8074
75+ // passthrough view to send touch events to underlaying ViewController
76+ LPHitView* passthroughView = (LPHitView *) self.view ;
77+ if (passthroughView) {
78+ passthroughView.shouldAllowTapToClose = tapOutside;
79+ passthroughView.touchDelegate = self.presentingViewController .view ;
80+ }
81+
8182 _orientation = UIDevice.currentDevice .orientation ;
8283 [[NSNotificationCenter defaultCenter ] addObserver: self
8384 selector: @selector (orientationDidChange: )
Original file line number Diff line number Diff line change 1111@interface LPHitView : UIView
1212
1313@property (weak , nonatomic ) UIView *touchDelegate;
14+ @property (assign ) BOOL shouldAllowTapToClose;
1415
1516- (UIView *)hitTest : (CGPoint)point withEvent : (UIEvent *)event ;
1617
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
1818 return nil ;
1919 }
2020
21- if (hitView != self) {
21+ if (hitView != self || _shouldAllowTapToClose ) {
2222 return hitView;
2323 }
2424
You can’t perform that action at this time.
0 commit comments