developer
2023-05-20 e12c7b4c22df631ebdcd16b2f98fbef8f738f92f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/*
 * WVWKWebView.h
 * 
 * Created by WindVane.
 * Copyright (c) 2017年 阿里巴巴-淘宝技术部. All rights reserved.
 */
 
#import "WVWebViewDelegate.h"
#import "WVWebViewProtocol.h"
#import <WebKit/WebKit.h>
 
 
NS_CLASS_AVAILABLE_IOS(8_0)
@interface WVWKWebView : WKWebView <WVWebViewProtocol>
 
/**
 * 挂载的归属源 UIViewController
 */
@property (nonatomic, weak) UIViewController * sourceViewController;
 
#pragma mark - Load Request
 
/**
 * 当前加载的请求
 */
@property (nonatomic, readonly, copy) NSURLRequest * request;
 
#pragma mark - Delegate
 
/**
 * 当前 WebView 的委托。
 */
@property (nonatomic, weak) id<WVWebViewDelegate> windVaneDelegate;
 
/**
 * WKWebView 默认的 navigationDelegate 与 UIWebView 无法兼容,因此请使用 windVaneDelegate。
 */
@property (nonatomic, weak) id<WKNavigationDelegate> navigationDelegate DEPRECATED_MSG_ATTRIBUTE("请使用 windVaneDelegate");
 
#pragma mark - Life cycle
 
/**
 * [注意:必须在 ViewController 的 viewWillDisappear 中调用!!!] 释放 WebView 的服务。
 */
- (void)releaseWebViewService;
 
/**
 * [注意:必须在 ViewController 的 viewWillAppear 中调用!!!] 重新绑定 WebView 的服务。
 */
- (void)bindingWebViewService;
 
#pragma mark - JSBridge
 
/**
 * 是否开启 JSBridge 服务,默认为 NO。
 */
@property (nonatomic, assign, getter=isOpenLocalService) BOOL openLocalService;
 
/**
 执行一次 WKWebView 的 Cookie 同步。
 */
+ (void)syncCookie;
 
@end