TCGBWebViewController Class Reference

Inherits from UIViewController
Conforms to UINavigationBarDelegate
UIWebViewDelegate
Declared in TCGBWebViewController.h

Overview

The TCGBWebViewController is a view controller class which have webview, headerview, maskview and etc.

Properties

  maskView

Mask View.

@property (nonatomic, strong) UIView *maskView

Discussion

Only used in popup launch style.

Declared In

TCGBWebViewController.h

  headerView

Header View.

@property (nonatomic, strong) UIView *headerView

Discussion

Only used in popup launch style.

Declared In

TCGBWebViewController.h

  theWebView

Web View.

@property (nonatomic, strong) UIWebView *theWebView

Discussion

You can handle this webView through custom scheme.

See Also

  • [TCGBWebBrowser addCustomScheme]

    [TCGBWebBrowser addCustomScheme:@"gamebase://getUserInformation" block:^(TCGBWebViewController *browserController, TCGBWebURL *webURL) {
         NSLog(@"%@ 호출!", webURL.host);
    
         NSString *userID = [TCGBGamebase userID];
         NSString *registeredDate = @"-";
         NSArray *authList = [TCGBGamebase authMappingList];
         NSString *authListString = [authList componentsJoinedByString:@", "];
    
         NSMutableString *javascript = [[NSMutableString alloc] init];
         __block NSMutableString *params = [[NSMutableString alloc] init];
         __block NSMutableString *callback = [[NSMutableString alloc] init];
         [webURL.query enumerateKeysAndObjectsUsingBlock:^(id  _Nonnull key, id  _Nonnull obj, BOOL * _Nonnull stop) {
         if ([key caseInsensitiveCompare:@"callback"] == NSOrderedSame) {
         callback = obj;
         }
         }];
    
         [params appendFormat:@"'%@',", userID];
         [params appendFormat:@"'%@',", registeredDate];
         [params appendFormat:@"'%@',", authListString];
    
         [javascript appendFormat:@"javascript:%@(%@)", callback, params];
         [browserController.theWebView stringByEvaluatingJavaScriptFromString:javascript];
     }];
    

Declared In

TCGBWebViewController.h

  navBar

Navigatino Bar.

@property (nonatomic, strong) UINavigationBar *navBar

Discussion

Only used in full screen launch style.

Declared In

TCGBWebViewController.h

  configuration

WebView Configuration.

@property (nonatomic, strong) TCGBWebConfiguration *configuration

Discussion

You can handle the webview with this configuration property.

Declared In

TCGBWebViewController.h

  delegate

UIViewController Delegate.

@property (nonatomic, strong) UIViewController *delegate

Discussion

It is used to delegate UIViewController’s methods such as viewDidLoad: viewWillLoad: viewDidDisappear: and etc. It is setted by configuration property.

Declared In

TCGBWebViewController.h

Initialization

– initWithConfiguration:

Initialization with TCGBWebConfiguration.

- (instancetype)initWithConfiguration:(TCGBWebConfiguration *)configuration

Parameters

configuration

With this property, TCGBWebViewController initialize its components such as webview, orientation, launch style and so on.

Declared In

TCGBWebViewController.h

Launching

– launcheWebViewWithURL:viewController:

Launching WebView that is not for local url.

- (void)launcheWebViewWithURL:(NSString *)urlString viewController:(UIViewController *)viewController

Parameters

urlString

The string value for target url

viewController

The presenting view controller

Declared In

TCGBWebViewController.h

– launcheWebViewWithLocalURL:bundle:viewController:

Launching WebView for local html (or other resources)

- (void)launcheWebViewWithLocalURL:(NSString *)localFilePath bundle:(NSBundle *)bundle viewController:(UIViewController *)viewController

Parameters

localFilePath

The string value for target local path.

bundle

Where the file is located.

viewController

The presenting view controller

Declared In

TCGBWebViewController.h

WebView Delegate

– goBackButtonPressed

Go Back Button pressed.

- (void)goBackButtonPressed

Declared In

TCGBWebViewController.h

– closeButtonPressed

Close Button Pressed.

- (void)closeButtonPressed

Discussion

Only used in full screen launch style.

Declared In

TCGBWebViewController.h