Skip to content

Commit ce1e195

Browse files
author
Greg Bolsinga
authored
Ensure ASControlMode properties lock before accessing their ivars (TextureGroup#1476)
Enable `#pragma clang diagnostic error "-Wobjc-missing-property-synthesis"` for this file.
1 parent d6061f4 commit ce1e195

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

Source/ASControlNode.h

+5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111

1212
#pragma once
1313

14+
#pragma clang diagnostic push
15+
#pragma clang diagnostic error "-Wobjc-missing-property-synthesis"
16+
1417
NS_ASSUME_NONNULL_BEGIN
1518

1619
/**
@@ -147,3 +150,5 @@ static UIControlState const ASControlStateSelected ASDISPLAYNODE_DEPRECATED_MSG(
147150
#endif
148151

149152
NS_ASSUME_NONNULL_END
153+
154+
#pragma clang diagnostic pop

Source/ASControlNode.mm

+63
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ @interface ASControlNode ()
3333
// Control Attributes
3434
BOOL _enabled;
3535
BOOL _highlighted;
36+
BOOL _selected;
3637

3738
// Tracking
3839
BOOL _tracking;
@@ -121,6 +122,68 @@ - (void)__exitHierarchy
121122
}
122123
}
123124

125+
#pragma mark - ASDisplayNode Overrides
126+
127+
- (BOOL)isEnabled
128+
{
129+
ASLockScopeSelf();
130+
return _enabled;
131+
}
132+
133+
- (void)setEnabled:(BOOL)enabled
134+
{
135+
ASLockScopeSelf();
136+
_enabled = enabled;
137+
}
138+
139+
- (BOOL)isHighlighted
140+
{
141+
ASLockScopeSelf();
142+
return _highlighted;
143+
}
144+
145+
- (void)setHighlighted:(BOOL)highlighted
146+
{
147+
ASLockScopeSelf();
148+
_highlighted = highlighted;
149+
}
150+
151+
- (void)setSelected:(BOOL)selected
152+
{
153+
ASLockScopeSelf();
154+
_selected = selected;
155+
}
156+
157+
- (BOOL)isSelected
158+
{
159+
ASLockScopeSelf();
160+
return _selected;
161+
}
162+
163+
- (void)setTracking:(BOOL)tracking
164+
{
165+
ASLockScopeSelf();
166+
_tracking = tracking;
167+
}
168+
169+
- (BOOL)isTracking
170+
{
171+
ASLockScopeSelf();
172+
return _tracking;
173+
}
174+
175+
- (void)setTouchInside:(BOOL)touchInside
176+
{
177+
ASLockScopeSelf();
178+
_touchInside = touchInside;
179+
}
180+
181+
- (BOOL)isTouchInside
182+
{
183+
ASLockScopeSelf();
184+
return _touchInside;
185+
}
186+
124187
#pragma clang diagnostic push
125188
#pragma clang diagnostic ignored "-Wobjc-missing-super-calls"
126189

0 commit comments

Comments
 (0)