Skip to content

Commit

Permalink
Ensure ASControlMode properties lock before accessing their ivars (Te…
Browse files Browse the repository at this point in the history
…xtureGroup#1476)

Enable `#pragma clang diagnostic error "-Wobjc-missing-property-synthesis"` for this file.
  • Loading branch information
Greg Bolsinga committed May 1, 2019
1 parent d6061f4 commit ce1e195
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Source/ASControlNode.h
Expand Up @@ -11,6 +11,9 @@

#pragma once

#pragma clang diagnostic push
#pragma clang diagnostic error "-Wobjc-missing-property-synthesis"

NS_ASSUME_NONNULL_BEGIN

/**
Expand Down Expand Up @@ -147,3 +150,5 @@ static UIControlState const ASControlStateSelected ASDISPLAYNODE_DEPRECATED_MSG(
#endif

NS_ASSUME_NONNULL_END

#pragma clang diagnostic pop
63 changes: 63 additions & 0 deletions Source/ASControlNode.mm
Expand Up @@ -33,6 +33,7 @@ @interface ASControlNode ()
// Control Attributes
BOOL _enabled;
BOOL _highlighted;
BOOL _selected;

// Tracking
BOOL _tracking;
Expand Down Expand Up @@ -121,6 +122,68 @@ - (void)__exitHierarchy
}
}

#pragma mark - ASDisplayNode Overrides

- (BOOL)isEnabled
{
ASLockScopeSelf();
return _enabled;
}

- (void)setEnabled:(BOOL)enabled
{
ASLockScopeSelf();
_enabled = enabled;
}

- (BOOL)isHighlighted
{
ASLockScopeSelf();
return _highlighted;
}

- (void)setHighlighted:(BOOL)highlighted
{
ASLockScopeSelf();
_highlighted = highlighted;
}

- (void)setSelected:(BOOL)selected
{
ASLockScopeSelf();
_selected = selected;
}

- (BOOL)isSelected
{
ASLockScopeSelf();
return _selected;
}

- (void)setTracking:(BOOL)tracking
{
ASLockScopeSelf();
_tracking = tracking;
}

- (BOOL)isTracking
{
ASLockScopeSelf();
return _tracking;
}

- (void)setTouchInside:(BOOL)touchInside
{
ASLockScopeSelf();
_touchInside = touchInside;
}

- (BOOL)isTouchInside
{
ASLockScopeSelf();
return _touchInside;
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wobjc-missing-super-calls"

Expand Down

0 comments on commit ce1e195

Please sign in to comment.