File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55} = React ;
66
77class WKWebView extends React . Component {
8+
9+ goBack ( ) {
10+ this . refs . AQWebView . goBack ( ) ;
11+ }
12+
13+ goForward ( ) {
14+ this . refs . AQWebView . goForward ( ) ;
15+ }
16+
17+ canGoForward ( ) {
18+ this . refs . AQWebView . canGoForward ( ) ;
19+ }
20+
21+ canGoBack ( ) {
22+ this . refs . AQWebView . canGoBack ( ) ;
23+ }
24+
825 render ( ) {
9- return < AQWebView { ...this . props } /> ;
26+ return < AQWebView ref = "AQWebView" { ...this . props } /> ;
1027 }
28+
1129}
1230
1331WKWebView . propTypes = {
Original file line number Diff line number Diff line change 88@property (nonatomic , copy ) NSArray <NSString*> *blockedPrefixes;
99
1010- (void )reload ;
11+ - (void )goBack ;
12+ - (void )goForward ;
13+ - (BOOL )canGoBack ;
14+ - (BOOL )canGoForward ;
1115
1216@end
Original file line number Diff line number Diff line change @@ -72,6 +72,26 @@ - (void)reload
7272 [_webView loadRequest: [NSURLRequest requestWithURL: _webView.URL ]];
7373}
7474
75+ - (void )goBack
76+ {
77+ [_webView goBack ];
78+ }
79+
80+ - (void )goForward
81+ {
82+ [_webView goForward ];
83+ }
84+
85+ - (BOOL )canGoBack
86+ {
87+ return [_webView canGoBack ];
88+ }
89+
90+ - (BOOL )canGoForward
91+ {
92+ return [_webView canGoForward ];
93+ }
94+
7595- (void )setSource : (NSDictionary *)source
7696{
7797 if (![_source isEqualToDictionary: source]) {
You can’t perform that action at this time.
0 commit comments