TCGBWebView Class Reference
Inherits from | NSObject |
---|---|
Declared in | TCGBWebView.h |
Properties
defaultWebConfiguration
This property is a global configuration for launching webview.
When you handle the webview without any configuration, TCGBWebView set its configuration with this value.
@property (nonatomic, strong) TCGBWebViewConfiguration *defaultWebConfiguration
Declared In
TCGBWebView.h
Initialization
+ sharedTCGBWebView
Creates and returns an TCGBWebView
object.
+ (instancetype)sharedTCGBWebView
Declared In
TCGBWebView.h
Launching WebView
+ showWebViewWithURL:viewController:configuration:closeCompletion:schemeList:schemeEvent:
Show WebView that is not for local url.
+ (void)showWebViewWithURL:(NSString *)urlString viewController:(UIViewController *)viewController configuration:(TCGBWebViewConfiguration *)configuration closeCompletion:(TCGBWebViewCloseCompletion)closeCompletion schemeList:(NSArray<NSString*> *)schemeList schemeEvent:(TCGBWebViewSchemeEvent)schemeEvent
Parameters
urlString |
The string value for target url |
---|---|
viewController |
The presenting view controller |
configuration |
This configuration is applied to the behavior of webview. |
closeCompletion |
This completion would be called when webview is closed |
schemeList |
This schemeList would be filtered every web view request and call schemeEvent |
schemeEvent |
This schemeEvent would be called when web view request matches one of the schemeLlist |
Availability
Added 1.5.0.
Discussion
Warning: If viewController is nil, TCGBWebView set it to top most view controller automatically.
Warning: If configuration is nil, TCGBWebView set it to default value. It is described in TCGBWebViewConfiguration
.
Declared In
TCGBWebView.h
+ showWebViewWithLocalURL:bundle:viewController:configuration:closeCompletion:schemeList:schemeEvent:
Show WebView for local html (or other web resources)
+ (void)showWebViewWithLocalURL:(NSString *)filePath bundle:(NSBundle *)bundle viewController:(UIViewController *)viewController configuration:(TCGBWebViewConfiguration *)configuration closeCompletion:(TCGBWebViewCloseCompletion)closeCompletion schemeList:(NSArray<NSString*> *)schemeList schemeEvent:(TCGBWebViewSchemeEvent)schemeEvent
Parameters
filePath |
The string value for target local path. |
---|---|
bundle |
where the html file is located. |
viewController |
The presenting view controller |
configuration |
This configuration is applied to the behavior of webview. |
closeCompletion |
This completion would be called when webview is closed |
schemeList |
This schemeList would be filtered every web view request and call schemeEvent |
schemeEvent |
This schemeEvent would be called when web view request matches one of the schemeLlist |
Availability
Added 1.5.0.
Discussion
Warning: If bundle is nil, TCGBWebView set it to main bundle automatically.
Warning: If viewController is nil, TCGBWebView set it to top most view controller automatically.
Warning: If configuration is nil, TCGBWebView set it to default value. It is described in TCGBWebViewConfiguration
.
Declared In
TCGBWebView.h
+ openWebBrowserWithURL:
Open the Browser with urlString
+ (void)openWebBrowserWithURL:(NSString *)urlString
Parameters
urlString |
The URL to be loaded. |
---|
Availability
Added 1.5.0.
Discussion
Warning: If urlString is not valid, to open browser would be failed. Please check the url before calling.
Declared In
TCGBWebView.h
+ closeWebView
Close the presenting Webview
+ (void)closeWebView
Availability
Added 1.5.0.
Declared In
TCGBWebView.h