mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-24 07:05:35 +00:00
Use instance variable for tracking if a target was added to ASControlNode
This commit is contained in:
@@ -19,12 +19,6 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface ASControlNode (Subclassing)
|
||||
|
||||
/**
|
||||
@abstract Indicates whether or not at least one target was added to the receiver
|
||||
@discussion YES if the receiver has at least one target; NO otherwise.
|
||||
*/
|
||||
@property (nonatomic, readonly, assign, getter=isTargetAdded) BOOL targetAdded;
|
||||
|
||||
/**
|
||||
@abstract Sends action messages for the given control events.
|
||||
@param controlEvents A bitmask whose set flags specify the control events for which action messages are sent. See "Control Events" in ASControlNode.h for bitmask constants.
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user