Use instance variable for tracking if a target was added to ASControlNode

This commit is contained in:
Michael Schneider
2016-02-02 08:30:52 -08:00
parent ddf50b20bd
commit 12e2b535db
2 changed files with 3 additions and 10 deletions

View File

@@ -48,7 +48,6 @@
}
// Read-write overrides.
@property (nonatomic, readwrite, assign, getter=isTargetAdded) BOOL targetAdded;
@property (nonatomic, readwrite, assign, getter=isTracking) BOOL tracking;
@property (nonatomic, readwrite, assign, getter=isTouchInside) BOOL touchInside;
@@ -89,14 +88,14 @@ void _ASEnumerateControlEventsIncludedInMaskWithBlock(ASControlNodeEvent mask, v
[super didLoad];
// As we have no targets yet, we start off with user interaction off. When a target is added, it'll get turned back on.
if (!self.targetAdded) {
if (!_targetAdded) {
self.userInteractionEnabled = NO;
}
}
- (BOOL)shouldTrackTouches
{
return self.isTargetAdded && self.enabled;
return _targetAdded && self.enabled;
}
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
@@ -270,7 +269,7 @@ void _ASEnumerateControlEventsIncludedInMaskWithBlock(ASControlNodeEvent mask, v
[targetActions addObject:NSStringFromSelector(action)];
});
self.targetAdded = YES;
_targetAdded = YES;
self.userInteractionEnabled = YES;
}