react-native-webview-bridge/ios/RCTWKWebView.h

39 lines
1.1 KiB
C
Raw Permalink Normal View History

2017-04-24 08:01:20 +00:00
#import "React/RCTView.h"
2015-12-08 17:06:22 +00:00
@class RCTWKWebView;
2015-12-08 17:06:22 +00:00
/**
* Special scheme used to pass messages to the injectedJavaScript
* code without triggering a page load. Usage:
*
* window.location.href = RCTJSNavigationScheme + '://hello'
*/
extern NSString *const RCTJSNavigationScheme;
@protocol RCTWKWebViewDelegate <NSObject>
2015-12-08 17:06:22 +00:00
- (BOOL)webView:(RCTWKWebView *)webView
2015-12-08 17:06:22 +00:00
shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
withCallback:(RCTDirectEventBlock)callback;
@end
@interface RCTWKWebView : RCTView
2015-12-08 17:06:22 +00:00
@property (nonatomic, weak) id<RCTWKWebViewDelegate> delegate;
2015-12-08 17:06:22 +00:00
@property (nonatomic, copy) NSDictionary *source;
2015-12-08 17:06:22 +00:00
@property (nonatomic, assign) UIEdgeInsets contentInset;
@property (nonatomic, assign) BOOL automaticallyAdjustContentInsets;
@property (nonatomic, assign) BOOL sendCookies;
2015-12-08 17:06:22 +00:00
@property (nonatomic, copy) NSString *injectedJavaScript;
@property (nonatomic, copy) NSString *injectedOnStartLoadingJavaScript;
2015-12-08 17:06:22 +00:00
- (void)goForward;
- (void)goBack;
- (void)reload;
- (void)evaluateJavaScript:(NSString *)javaScriptString completionHandler:(void (^)(id, NSError *error))completionHandler;
2015-12-08 22:16:58 +00:00
- (void)sendToBridge:(NSString *)message;
2015-12-08 17:06:22 +00:00
@end