TCGBWebView Class Reference

Inherits from NSObject
Declared in TCGBWebView.h

Overview

The TCGBWebView 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, TCGBWebView set its configuration with this value.

@property (nonatomic, strong) TCGBWebViewConfiguration *defaultWebConfiguration

Declared In

TCGBWebView.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

TCGBWebView.h

Initialization

+ sharedTCGBWebView

Creates and returns an TCGBWebView object.

+ (instancetype)sharedTCGBWebView

Declared In

TCGBWebView.h

Launching WebView

+ showWebBrowserWithURL:viewController:

Show Web Browser that has navigationbar and fullscreen.

+ (void)showWebBrowserWithURL:(NSString *)urlString viewController:(UIViewController *)viewController

Parameters

urlString

The string value for target url

viewController

The presenting view controller

Discussion

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

Declared In

TCGBWebView.h

+ showWebPopupWithURL:viewController:

Show Web PopUp that has navigationbar and fullscreen.

+ (void)showWebPopupWithURL:(NSString *)urlString viewController:(UIViewController *)viewController

Parameters

urlString

The string value for target url

viewController

The presenting view controller

Discussion

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

Declared In

TCGBWebView.h

+ showWebViewWithURL:viewController:configuration:

Show WebView that is not for local url.

+ (void)showWebViewWithURL:(NSString *)urlString viewController:(UIViewController *)viewController configuration:(TCGBWebViewConfiguration *)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, 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:

Show WebView for local html (or other web resources)

+ (void)showWebViewWithLocalURL:(NSString *)filePath bundle:(NSBundle *)bundle viewController:(UIViewController *)viewController configuration:(TCGBWebViewConfiguration *)configuration

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.

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

Managing Custom Scheme

+ addCustomScheme:block:

Add Custom Scheme

+ (void)addCustomScheme:(NSString *)schemeString block:(void ( ^ ) ( UIViewController<TCGBWebViewDelegate> *viewController , 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

TCGBWebView.h

+ removeCustomScheme:

Remove Custom Scheme

+ (void)removeCustomScheme:(NSString *)schemeString

Parameters

schemeString

This string is the key of schemeCallbackDictionary.

Declared In

TCGBWebView.h