blob: d2e92d2909c87d2161ed5ad9d4fac6eff906e668 [file] [log] [blame]
{
"name": "UIWebView-Blocks",
"version": "1.0",
"summary": "UIWebView+Blocks is A simple category that implements blocks into UIWebView.",
"description": " \tUIWebView-Blocks\n ================\n\n UIWebView+Blocks is A simple category that implements blocks into UIWebView.\n This allows you to use the power of blocks instead of implementing a delegate.\n\n USAGE FOR NSURLRequests\n ------\n\n Instead of allocating a new UIWebView and assigning a delegate, just call one of the static methods:\n\n ```objc\n UIWebView *webView = [UIWebView loadRequest:[NSURLRequest requestWithURL: [NSURL URLWithString:@\"http://google.com\"]]\n loaded:^(UIWebView *webView) {\n NSLog(@\"Loaded successfully\");\n }\n failed:^(UIWebView *webView, NSError *error) {\n NSLog(@\"Failed loading %@\", error);\n }];\n ```\n\n **OR**\n\n ```objc\n UIWebView *webView = [UIWebView loadRequest:[NSURLRequest requestWithURL: [NSURL URLWithString:@\"http://google.com\"]]\n loaded:^(UIWebView *webView) {\n NSLog(@\"Loaded successfully\");\n }\n failed:^(UIWebView *webView, NSError *error) {\n NSLog(@\"Failed loading %@\", error);\n }\n loadStarted:^(UIWebView *webView) {\n NSLog(@\"Started loading %@\", webView.request.URL.absoluteString);\n }\n shouldLoad:^BOOL(UIWebView *webView, UIWebViewNavigationType navigationType) {\n return YES;\n }];\n ```\n\n USAGE FOR HTML Strings\n -------\n\n ```objc\n UIWebView *webView = [UIWebView loadHTMLString:htmlString\n loaded:^(UIWebView *) {\n NSLog(@\"Loaded successfully\");\n }\n failed:^(UIWebView *, NSError *) {\n NSLog(@\"Failed loading %@\", error);\n }];\n ```\n\n **OR**\n\n ```objc\n UIWebView *webView = [UIWebView loadHTMLString:htmlString\n loaded:^(UIWebView *) {\n NSLog(@\"Loaded successfully\");\n }\n failed:^(UIWebView *, NSError *) {\n NSLog(@\"Failed loading %@\", error);\n }\n loadStarted:^(UIWebView *webView) {\n NSLog(@\"Started loading %@\", webView.request.URL.absoluteString);\n }\n shouldLoad:^BOOL(UIWebView *webView, NSURLRequest *request, UIWebViewNavigationType navigationType) {\n return YES;\n }];\n ```\n\n\n The class will return the UIWebView object which you can later add as a subview to your current view.\n\n ```objc\n webView.frame = [[UIScreen mainScreen] bounds];\n [self.view addSubview: webView];\n ```\n\n\n ***Note:*** UIWebView+Blocks currently doesn't support the simultaneous usage of multiple UIWebViews in the same view.\n\n TRUE ENDING REPORTING\n ---------------------\n\n In UIWebView+Blocks.h, set `TRUE_END_REPORT` to YES if you wish to get notified only when the page is fully loaded instead of being notified every time a resource is loaded (default UIWebViewDelegate behavior).\n This feature is still under beta and might not work perfectly at all times. \n",
"homepage": "https://github.com/freak4pc/UIWebView-Blocks",
"license": "MIT",
"authors": {
"Shai Mishali": "freak4pc@gmail.com"
},
"platforms": {
"ios": null
},
"source": {
"git": "https://github.com/freak4pc/UIWebView-Blocks.git",
"tag": "v1.0"
},
"source_files": "UIWebView+Blocks.**",
"exclude_files": "UIWebView-BlocksExample/**",
"requires_arc": true
}