BBASMComponentTouchDelegate.h 2.04 KB
//
//  BBASMComponentTouchDelegate.h
//  SWAN
//
//  Created by baidu on 2018/7/25.
//  Copyright © 2018年 baidu. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@protocol BBASMComponentTouchDelegate <NSObject>

/**
 *  第一次手势触发
 *
 */
- (void)firstTouch;

/**
 *  手势结束,包含正常、错误、取消
 *
 */
- (void)touchFinished;

/**
 *  长按触发
 *
 */
- (void)longPressStart;

/**
 *  长按结束
 *
 */
- (void)longPressEnd;

/**
 *  触发Touch事件
 *
 *  @params all         所有手势
 *  @params changed     修改的手势
 *  @params remaining   屏幕上面的手势
 */
- (void)triggerEvent:(NSString *)name
           timestamp:(NSTimeInterval)timestamp
                 all:(NSSet *)all
             changed:(NSSet *)changed
           remaining:(NSSet *)remaining;

/**
 *  是否支持全屏手势
 *
 */
- (BOOL)supportFullscreenPopGesture;


// Generally, all responders which do custom touch handling should override all four of these methods.
// Your responder will receive either touchesEnded:withEvent: or touchesCancelled:withEvent: for each
// touch it is handling (those touches it received in touchesBegan:withEvent:).
// *** You must handle cancelled touches to ensure correct behavior in your application.  Failure to
// do so is very likely to lead to incorrect behavior or crashes.
- (void)view:(UIView *)view touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event;
- (void)view:(UIView *)view touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event;
- (void)view:(UIView *)view touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event;
- (void)view:(UIView *)view touchesCancelled:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event;

/**
 是否是首次触摸
 */
@property (nonatomic, assign) BOOL isFirstTouch;

///当在 组件 中移动时且有绑定手势事件时,禁止屏幕滚动以及下拉刷新
@property (nonatomic, assign) BOOL disableScroll;

 /// 开启touch事件
@property (nonatomic, assign) BOOL enableTouchEvent;

@end