TCGBWebViewController Class Reference
Inherits from | UIViewController |
---|---|
Conforms to | TCGBWebViewDelegate 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
[TCGBWebView addCustomScheme]
[TCGBWebView 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
configuration
WebView Configuration.
@property (nonatomic, strong) TCGBWebViewConfiguration *configuration
Discussion
You can handle the webview with this configuration property.
Declared In
TCGBWebViewController.h
delegate
UIViewController Delegate.
@property (nonatomic, strong) id<TCGBWebViewDelegate> delegate
Discussion
It is used to delegate UIViewController’s methods such as viewDidLoad: viewWillLoad: viewDidDisappear: and etc. It is setted by configuration property.
See Also
Declared In
TCGBWebViewController.h
Initialization
– initWithConfiguration:
Initialization with TCGBWebViewConfiguration.
- (instancetype)initWithConfiguration:(TCGBWebViewConfiguration *)configuration
Parameters
configuration |
With this property, TCGBWebViewController initialize its components such as webview, orientation, launch style and so on. |
---|
Declared In
TCGBWebViewController.h
Launching
– showWebViewWithURL:
Show WebView that is not for local url.
- (void)showWebViewWithURL:(NSString *)urlString
Parameters
urlString |
The string value for target url |
---|
Declared In
TCGBWebViewController.h
– showWebViewWithLocalURL:bundle:
Show WebView for local html (or other resources)
- (void)showWebViewWithLocalURL:(NSString *)localFilePath bundle:(NSBundle *)bundle
Parameters
localFilePath |
The string value for target local path. |
---|---|
bundle |
Where the file is located. |
Declared In
TCGBWebViewController.h