BBASMSlaveWebView.h 1.2 KB
//
//  BBASMSlaveWebView.h
//  SWAN
//
//  Created by baidu on 2018/5/22.
//  Copyright © 2018年 baidu. All rights reserved.
//

#import <WebKit/WebKit.h>
/// 手百使用BDPWKWebView做网络拦截
#if __has_include(<BDPWKWebView/BDPWKWebView.h>)
#import <BDPWKWebView/BDPWKWebView.h>
#define INCLUDE_BDPWKWEBVIEW 1
#else
#define INCLUDE_BDPWKWEBVIEW 0
#endif

@class BBASMSlaveWebView;
@protocol BBASMSlaveWebViewTouchDelegate <NSObject>

@optional;
/**
 * @brief 透传hitTest
 *
 * @param webView  webView
 * @param point point
 * @param event event
 * @param hitedView webView hitTest返回的view
 */
- (void)webView:(BBASMSlaveWebView *)webView
        hitTest:(CGPoint)point
      withEvent:(UIEvent *)event
      hitedView:(UIView **)hitedView;

/**
 * @brief childScrollView 被添加到了视图树中
 *
 * @param webView webView
 * @param scrollView scrollView
 */
- (void)webView:(BBASMSlaveWebView *)webView
sameLayerComponentDidChangeScrollView:(UIScrollView *)scrollView;
@end

#if INCLUDE_BDPWKWEBVIEW
@interface BBASMSlaveWebView : BDPBASEWKWebView
#else
@interface BBASMSlaveWebView : WKWebView
#endif

/// 触摸事件代理
@property (nonatomic, weak) id<BBASMSlaveWebViewTouchDelegate> touchDelegate;

@end