Skip to content

Commit

Permalink
restored timing to setting viewController.backgestureEnabled
Browse files Browse the repository at this point in the history
  • Loading branch information
ishkawa committed Aug 8, 2013
1 parent c25b4c5 commit 48d39e8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ISBackGesture/UIViewController+BackGesture.m
Expand Up @@ -54,15 +54,15 @@ - (BOOL)backGestureEnabled

- (void)setBackGestureEnabled:(BOOL)backGestureEnabled
{
objc_setAssociatedObject(self, ISBackGestureEnabledKey, @(backGestureEnabled), OBJC_ASSOCIATION_RETAIN_NONATOMIC);

if (self.isViewLoaded) {
if (backGestureEnabled) {
[self startRecognizing];
} else {
[self stopRecognizing];
}
}

objc_setAssociatedObject(self, ISBackGestureEnabledKey, @(backGestureEnabled), OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}

- (UIPanGestureRecognizer *)backGestureRecognizer
Expand Down Expand Up @@ -93,7 +93,7 @@ - (void)_viewDidUnload

- (void)startRecognizing
{
if (!self.isViewLoaded || self.backGestureEnabled) {
if (!self.isViewLoaded || !self.backGestureEnabled) {
return;
}

Expand All @@ -108,7 +108,7 @@ - (void)startRecognizing

- (void)stopRecognizing
{
if (!self.isViewLoaded || !self.backGestureEnabled) {
if (!self.isViewLoaded || self.backGestureEnabled) {
return;
}

Expand Down

0 comments on commit 48d39e8

Please sign in to comment.