NS_ASSUME_NONNULL_BEGIN
NS_CLASS_AVAILABLE_IOS ( 9 _0) @interface UIPressesEvent : UIEvent
- ( NSSet < UIPress *> *)allPresses;
- ( NSSet < UIPress *> *)pressesForGestureRecognizer:( UIGestureRecognizer *)gesture;
@end
NS_ASSUME_NONNULL_END
#endif
#ifndef SDK_HIDE_TIDE
//触摸事件
@property
(
nonatomic
,
copy
)
NSArray
<
NSNumber
*> *allowedTouchTypes
NS_AVAILABLE_IOS
(
9
_0);
// Array of UITouchType's as NSNumbers.
//按压事件
@property
(
nonatomic
,
copy
)
NSArray
<
NSNumber
*> *allowedPressTypes
NS_AVAILABLE_IOS
(
9
_0);
// Array of UIPressTypes as NSNumbers.
NS_ENUM_AVAILABLE_IOS
(
9
_0)
typedef
NS_ENUM
(NSInteger, UIPressPhase) {
UIPressPhaseBegan, // whenever a button press begins.
UIPressPhaseChanged, // whenever a button moves.
UIPressPhaseStationary, // whenever a buttons was pressed and is still being held down.
UIPressPhaseEnded, // whenever a button is releasd.
UIPressPhaseCancelled, // whenever a button press doesn't end but we need to stop tracking.
};
NS_ENUM_AVAILABLE_IOS ( 9 _0) typedef NS_ENUM (NSInteger, UIPressType) {
UIPressTypeUpArrow,
UIPressTypeDownArrow,
UIPressTypeLeftArrow,
UIPressTypeRightArrow,
UIPressTypeSelect,
UIPressTypeMenu,
UIPressTypePlayPause,
};
NS_CLASS_AVAILABLE_IOS ( 9 _0) @interface UIPress : NSObject
@property ( nonatomic , readonly ) NSTimeInterval timestamp;
@property ( nonatomic , readonly ) UIPressPhase phase;
@property ( nonatomic , readonly ) UIPressType type;
@property ( nullable , nonatomic , readonly , strong ) UIWindow *window;
@property ( nullable , nonatomic , readonly , strong ) UIResponder *responder;
@property ( nullable , nonatomic , readonly , copy ) NSArray < UIGestureRecognizer *> *gestureRecognizers;
// For analog buttons, returns a value between 0 and 1. Digital buttons return 0 or 1.
@property ( nonatomic , readonly ) CGFloat force;
@end
UIPressPhaseBegan, // whenever a button press begins.
UIPressPhaseChanged, // whenever a button moves.
UIPressPhaseStationary, // whenever a buttons was pressed and is still being held down.
UIPressPhaseEnded, // whenever a button is releasd.
UIPressPhaseCancelled, // whenever a button press doesn't end but we need to stop tracking.
};
NS_ENUM_AVAILABLE_IOS ( 9 _0) typedef NS_ENUM (NSInteger, UIPressType) {
UIPressTypeUpArrow,
UIPressTypeDownArrow,
UIPressTypeLeftArrow,
UIPressTypeRightArrow,
UIPressTypeSelect,
UIPressTypeMenu,
UIPressTypePlayPause,
};
NS_CLASS_AVAILABLE_IOS ( 9 _0) @interface UIPress : NSObject
@property ( nonatomic , readonly ) NSTimeInterval timestamp;
@property ( nonatomic , readonly ) UIPressPhase phase;
@property ( nonatomic , readonly ) UIPressType type;
@property ( nullable , nonatomic , readonly , strong ) UIWindow *window;
@property ( nullable , nonatomic , readonly , strong ) UIResponder *responder;
@property ( nullable , nonatomic , readonly , copy ) NSArray < UIGestureRecognizer *> *gestureRecognizers;
// For analog buttons, returns a value between 0 and 1. Digital buttons return 0 or 1.
@property ( nonatomic , readonly ) CGFloat force;
@end
#endif