@@ -77,7 +77,7 @@ @implementation ECSlidingViewController
77
77
@synthesize underRightWidthLayout = _underRightWidthLayout;
78
78
@synthesize underLeftWidthLayout = _underLeftWidthLayout;
79
79
@synthesize shouldAllowUserInteractionsWhenAnchored;
80
- @synthesize resetStrategy;
80
+ @synthesize resetStrategy = _resetStrategy ;
81
81
82
82
// category properties
83
83
@synthesize topViewSnapshot;
@@ -169,9 +169,10 @@ - (void)viewDidLoad
169
169
{
170
170
[super viewDidLoad ];
171
171
self.shouldAllowUserInteractionsWhenAnchored = NO ;
172
- self.resetStrategy = ECTapping | ECPanning;
173
172
self.resetTapGesture = [[UITapGestureRecognizer alloc ] initWithTarget: self action: @selector (resetTopView )];
174
173
_panGesture = [[UIPanGestureRecognizer alloc ] initWithTarget: self action: @selector (updateTopViewHorizontalCenterWithRecognizer: )];
174
+ self.resetTapGesture .enabled = NO ;
175
+ self.resetStrategy = ECTapping | ECPanning;
175
176
176
177
self.topViewSnapshot = [[UIView alloc ] initWithFrame: self .topView.bounds];
177
178
[self .topViewSnapshot setAutoresizingMask: self .autoResizeToFillScreen];
@@ -199,6 +200,16 @@ - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceO
199
200
}
200
201
}
201
202
203
+ - (void )setResetStrategy : (ECResetStrategy)theResetStrategy
204
+ {
205
+ _resetStrategy = theResetStrategy;
206
+ if (_resetStrategy & ECTapping) {
207
+ self.resetTapGesture .enabled = YES ;
208
+ } else {
209
+ self.resetTapGesture .enabled = NO ;
210
+ }
211
+ }
212
+
202
213
- (void )adjustLayout
203
214
{
204
215
self.topViewSnapshot .frame = self.topView .bounds ;
@@ -279,7 +290,7 @@ - (void)anchorTopViewTo:(ECSide)side animations:(void (^)())animations onComplet
279
290
}
280
291
[self updateTopViewHorizontalCenter: newCenter];
281
292
} completion: ^(BOOL finished){
282
- if (resetStrategy & ECPanning) {
293
+ if (_resetStrategy & ECPanning) {
283
294
self.panGesture .enabled = YES ;
284
295
} else {
285
296
self.panGesture .enabled = NO ;
0 commit comments