No Description

RNCWebView.h 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. * Copyright (c) 2018-present, Infinite Red, Inc.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. #import <React/RCTView.h>
  8. @class RNCWebView;
  9. /**
  10. * Special scheme used to pass messages to the injectedJavaScript
  11. * code without triggering a page load. Usage:
  12. *
  13. * window.location.href = RCTJSNavigationScheme + '://hello'
  14. */
  15. extern NSString *const RCTJSNavigationScheme;
  16. @protocol RNCWebViewDelegate <NSObject>
  17. - (BOOL)webView:(RNCWebView *)webView
  18. shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
  19. withCallback:(RCTDirectEventBlock)callback;
  20. @end
  21. @interface RNCWebView : RCTView
  22. @property (nonatomic, weak) id<RNCWebViewDelegate> delegate;
  23. @property (nonatomic, copy) NSDictionary *source;
  24. @property (nonatomic, assign) UIEdgeInsets contentInset;
  25. @property (nonatomic, assign) BOOL automaticallyAdjustContentInsets;
  26. @property (nonatomic, assign) BOOL messagingEnabled;
  27. @property (nonatomic, copy) NSString *injectedJavaScript;
  28. @property (nonatomic, assign) BOOL scalesPageToFit;
  29. - (void)goForward;
  30. - (void)goBack;
  31. - (void)reload;
  32. - (void)stopLoading;
  33. - (void)postMessage:(NSString *)message;
  34. - (void)injectJavaScript:(NSString *)script;
  35. @end