UIPressPhase API


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
#endif
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值