File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
ECSlidingViewController/Vendor/ECSlidingViewController Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -172,6 +172,10 @@ - (void)viewDidLoad
172
172
self.resetStrategy = ECTapping | ECPanning;
173
173
self.resetTapGesture = [[UITapGestureRecognizer alloc ] initWithTarget: self action: @selector (resetTopView )];
174
174
_panGesture = [[UIPanGestureRecognizer alloc ] initWithTarget: self action: @selector (updateTopViewHorizontalCenterWithRecognizer: )];
175
+
176
+ self.topViewSnapshot = [[UIView alloc ] initWithFrame: self .topView.bounds];
177
+ [self .topViewSnapshot setAutoresizingMask: self .autoResizeToFillScreen];
178
+ [self .topViewSnapshot addGestureRecognizer: self .resetTapGesture];
175
179
}
176
180
177
181
- (void )viewWillAppear : (BOOL )animated
@@ -400,18 +404,15 @@ - (void)topViewHorizontalCenterDidChange:(CGFloat)newHorizontalCenter
400
404
- (void )addTopViewSnapshot
401
405
{
402
406
if (!self.topViewSnapshot .superview && !self.shouldAllowUserInteractionsWhenAnchored ) {
403
- self.topViewSnapshot = [[UIView alloc ] initWithFrame: self .topView.bounds];
404
407
topViewSnapshot.layer .contents = (id )[UIImage imageWithUIView: self .topView].CGImage ;
405
408
[self .topView addSubview: self .topViewSnapshot];
406
- [self .topViewSnapshot addGestureRecognizer: self .resetTapGesture];
407
409
}
408
410
}
409
411
410
412
- (void )removeTopViewSnapshot
411
413
{
412
414
if (self.topViewSnapshot .superview ) {
413
415
[self .topViewSnapshot removeFromSuperview ];
414
- topViewSnapshot = nil ;
415
416
}
416
417
}
417
418
You can’t perform that action at this time.
0 commit comments