Replace ASButtonState with ASControlState

This commit is contained in:
Bin Liu
2016-01-05 17:07:44 -08:00
parent 8a5f080fcc
commit 6bb51063f9
4 changed files with 57 additions and 26 deletions

View File

@@ -34,6 +34,13 @@ typedef NS_OPTIONS(NSUInteger, ASControlNodeEvent)
ASControlNodeEventAllEvents = 0xFFFFFFFF
};
typedef NS_OPTIONS(NSUInteger, ASControlState) {
ASControlStateNormal = 0,
ASControlStateHighlighted = 1 << 0, // used when ASControlNode isHighlighted is set
ASControlStateDisabled = 1 << 1,
ASControlStateSelected = 1 << 2, // used when ASControlNode isSeleted is set
ASControlStateReserved = 0xFF000000 // flags reserved for internal framework use
};
/**
@abstract ASControlNode is the base class for control nodes (such as buttons), or nodes that track touches to invoke targets with action messages.
@@ -55,6 +62,12 @@ typedef NS_OPTIONS(NSUInteger, ASControlNodeEvent)
*/
@property (nonatomic, readonly, assign, getter=isHighlighted) BOOL highlighted;
/**
@abstract Indicates whether or not the receiver is highlighted.
@discussion This is set automatically when the receiver is tapped.
*/
@property (nonatomic, assign, getter=isSeleted) BOOL selected;
#pragma mark - Tracking Touches
/**
@abstract Indicates whether or not the receiver is currently tracking touches related to an event.