TCGBWebBrowser Class Reference

Inherits from NSObject
Declared in TCGBWebBrowser.h

Overview

The TCGBWebBrowser class represents the entry point for launching WebView.

Properties

  defaultWebConfiguration

This property is a global configuration for launching webview.
When you handle the webview without any configuration, TCGBWebBrowser set its configuration with this value.

@property (nonatomic, strong) TCGBWebConfiguration *defaultWebConfiguration

Declared In

TCGBWebBrowser.h

  schemeCallbackDictionary

This dictionary contains key-action objectes.
Each key represents custom scheme, and each action is completionHandler.

@property (nonatomic, strong) NSMutableDictionary *schemeCallbackDictionary

Declared In

TCGBWebBrowser.h

Initialization

+ sharedTCGBWebBrowser

Creates and returns an TCGBWebBrowser object.

+ (instancetype)sharedTCGBWebBrowser

Declared In

TCGBWebBrowser.h

Launching WebView

+ launchWebViewWithURL:viewController:configuration:

Launching WebView that is not for local url.

+ (void)launchWebViewWithURL:(NSString *)urlString viewController:(UIViewController *)viewController configuration:(TCGBWebConfiguration *)configuration

Parameters

urlString

The string value for target url

viewController

The presenting view controller

configuration

This configuration is applied to the behavior of webview.

Discussion

Warning: If viewController is nil, TCGBWebBrowser set it to top most view controller automatically.

Warning: If configuration is nil, TCGBWebBrowser set it to default value. It is described in TCGBWebConfiguration.

Declared In

TCGBWebBrowser.h

+ launcheWebViewWithLocalURL:bundle:viewController:configuration:

Launching WebView for local html (or other resources)

+ (void)launcheWebViewWithLocalURL:(NSString *)filePath bundle:(NSBundle *)bundle viewController:(UIViewController *)viewController configuration:(TCGBWebConfiguration *)configuration

Parameters

filePath

The string value for target local path.

bundle

Where the file is located.

viewController

The presenting view controller

configuration

This configuration is applied to the behavior of webview.

Discussion

Warning: If bundle is nil, TCGBWebBrowser set it to main bundle automatically.

Warning: If viewController is nil, TCGBWebBrowser set it to top most view controller automatically.

Warning: If configuration is nil, TCGBWebBrowser set it to default value. It is described in TCGBWebConfiguration.

Declared In

TCGBWebBrowser.h

Managing Custom Scheme

+ addCustomScheme:block:

Add Custom Scheme

+ (void)addCustomScheme:(NSString *)schemeString block:(void ( ^ ) ( TCGBWebViewController *TCGBWebViewController , TCGBWebURL *webURL ))handler

Parameters

schemeString

This string is the key that is called in html or the other place.

handler

This handler is a block which will be excuted by calling the schemeString, the key.

Declared In

TCGBWebBrowser.h

+ removeCustomScheme:

Remove Custom Scheme

+ (void)removeCustomScheme:(NSString *)schemeString

Parameters

schemeString

This string is the key of schemeCallbackDictionary.

Declared In

TCGBWebBrowser.h