Forwarded from Backup Legal Mega
Pastebin
HULU PREMIUM ACCOUNTS V - Pastebin.com
THIS CHANNEL STARTING 24/24 POSTS 😊
,excepting days when undercode is closed :)
> Use all tutorials For learning Only !!!!
,excepting days when undercode is closed :)
> Use all tutorials For learning Only !!!!
Forwarded from iUNDERCODE - iOs JAILBREAK & MODS
This media is not supported in your browser
VIEW IN TELEGRAM
Forwarded from iUNDERCODE - iOs JAILBREAK & MODS
▁ ▂ ▄ u𝕟𝔻Ⓔ𝐫Ć𝔬𝓓ⓔ ▄ ▂ ▁
🦑Introduction to the basic usage of WebView in iOS development
1) Use UIWebView to load a webpage to
run XCode 4.3, create a new Single View Application, and name it WebViewDemo.
🦑Introduction to the basic usage of WebView in iOS development
1) Use UIWebView to load a webpage to
run XCode 4.3, create a new Single View Application, and name it WebViewDemo.
Forwarded from iUNDERCODE - iOs JAILBREAK & MODS
2) Load WebView,
add WebView member variable in ViewController.h and add implementation in ViewController.m
> #import <UIKit / UIKit.h>
@interface ViewController: UIViewController
{
UIWebView * webView;
}
@end
ViewController.m-
(void) viewDidLoad
{
[super viewDidLoad];
webView = [[UIWebView alloc] initWithFrame: CGRectMake (0, 0, 320, 480)];
NSURLRequest * request = [NSURLRequest requestWithURL: [NSURL URLWithString: @ "http://www.baidu.com"]];
[self.view addSubview: webView];
[webView loadRequest: request];
}
🦑Run so that the Baidu web page opens-or google.com
add WebView member variable in ViewController.h and add implementation in ViewController.m
> #import <UIKit / UIKit.h>
@interface ViewController: UIViewController
{
UIWebView * webView;
}
@end
ViewController.m-
(void) viewDidLoad
{
[super viewDidLoad];
webView = [[UIWebView alloc] initWithFrame: CGRectMake (0, 0, 320, 480)];
NSURLRequest * request = [NSURLRequest requestWithURL: [NSURL URLWithString: @ "http://www.baidu.com"]];
[self.view addSubview: webView];
[webView loadRequest: request];
}
🦑Run so that the Baidu web page opens-or google.com
Baidu
百度一下,你就知道
全球领先的中文搜索引擎、致力于让网民更便捷地获取信息,找到所求。百度超过千亿的中文网页数据库,可以瞬间找到相关的搜索结果。
Forwarded from iUNDERCODE - iOs JAILBREAK & MODS
🦑The network environment of the mobile phone changes in real time.
When the network is slow, how to prompt the user that the webpage is opening? How to prompt the user when there is an error opening the webpage? At this time, we need to know when the web page opens,
when it loads, and when something goes wrong. Then we need to implement this <UIWebViewDelegate> protocol
3) Implement the protocol and modify it in ViewController.h as follows:
> code :
#import <UIKit / UIKit.h>
@interface ViewController: UIViewController <UIWebViewDelegate>
{
UIWebView * webView;
}
@end
When the network is slow, how to prompt the user that the webpage is opening? How to prompt the user when there is an error opening the webpage? At this time, we need to know when the web page opens,
when it loads, and when something goes wrong. Then we need to implement this <UIWebViewDelegate> protocol
3) Implement the protocol and modify it in ViewController.h as follows:
> code :
#import <UIKit / UIKit.h>
@interface ViewController: UIViewController <UIWebViewDelegate>
{
UIWebView * webView;
}
@end
Forwarded from iUNDERCODE - iOs JAILBREAK & MODS
🦑Hold down control + command + up arrow key, switch to ViewController.m file, this is what we type in the file-(void) webView, you can see the following implementation method:
Forwarded from iUNDERCODE - iOs JAILBREAK & MODS
4) UIWebView mainly has the following delegate methods:
1.- (void) webViewDidStartLoad: (UIWebView *) webView; execute this method when loading starts.
2.- (void) webViewDidFinishLoad: (UIWebView *) webView; execute this method when loading is completed.
3.- (void) webView: (UIWebView *) webView didFailLoadWithError: (NSError *) error; execute this method when loading error.
We can place activityIndicatorView into the first two delegate methods.
> code -(void) webViewDidStartLoad: (UIWebView *) webView
{
[activityIndicatorView startAnimating];
}
-(void) webViewDidFinishLoad: (UIWebView *) webView
{
[activityIndicatorView stopAnimating];
}
1.- (void) webViewDidStartLoad: (UIWebView *) webView; execute this method when loading starts.
2.- (void) webViewDidFinishLoad: (UIWebView *) webView; execute this method when loading is completed.
3.- (void) webView: (UIWebView *) webView didFailLoadWithError: (NSError *) error; execute this method when loading error.
We can place activityIndicatorView into the first two delegate methods.
> code -(void) webViewDidStartLoad: (UIWebView *) webView
{
[activityIndicatorView startAnimating];
}
-(void) webViewDidFinishLoad: (UIWebView *) webView
{
[activityIndicatorView stopAnimating];
}
Forwarded from iUNDERCODE - iOs JAILBREAK & MODS
🦑The buttonPress method is very simple, just call the
loadWebPageWithString method that we started to define:
Copy codecode show as below:
-(IBAction) buttonPress: (id) sender
{
[textField resignFirstResponder];
[self loadWebPageWithString: textField.text];
loadWebPageWithString method that we started to define:
Copy codecode show as below:
-(IBAction) buttonPress: (id) sender
{
[textField resignFirstResponder];
[self loadWebPageWithString: textField.text];
Forwarded from iUNDERCODE - iOs JAILBREAK & MODS
🦑When an error occurs on the request page, we give a hint:
Copy codecode show as below:
-(void) webView: (UIWebView *) webView didFailLoadWithError: (NSError *) error
{
UIAlertView * alterview = [[UIAlertView alloc] initWithTitle: @ "" message: [error localizedDescription] delegate: nil cancelButtonTitle: nil otherButtonTitles: @ "OK ", nil];
[alterview show];
[alterview release];
}
Copy codecode show as below:
-(void) webView: (UIWebView *) webView didFailLoadWithError: (NSError *) error
{
UIAlertView * alterview = [[UIAlertView alloc] initWithTitle: @ "" message: [error localizedDescription] delegate: nil cancelButtonTitle: nil otherButtonTitles: @ "OK ", nil];
[alterview show];
[alterview release];
}
Forwarded from iUNDERCODE - iOs JAILBREAK & MODS
5) Load waiting interface
In order to give users a more intuitive interface effect, we add the loading interface to try
to add wait in webViewDidStartLoad
Copy codecode show as below:
<strong>-(void) webViewDidStartLoad: (UIWebView *) webView
{
// Create UIActivityIndicatorView translucent View
UIView * view = [[UIView alloc] initWithFrame: CGRectMake (0, 0, 320, 480)];
[view setTag : 108];
[view setBackgroundColor: [UIColor blackColor]];
[view setAlpha: 0.5];
[self.view addSubview: view];
activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame: CGRectMake (0.0f, 0.0f, 32.0f, 32.0f)];
[activityIndicator setCenter: view.center];
[activityIndicator setActivityIndicatorViewStyle: UIActivityIndicatorViewStyleWhite];
[view addSubview: activityIndicator];
[activityIndicator startAnimating];
</ strong>
When loading is completed or failed, remove the loading effect
Copy codecode show as below:
<strong>-(void) webViewDidFinishLoad: (UIWebView *) webView
{
[activityIndicator stopAnimating];
UIView * view = (UIView *) [self.view viewWithTag: 108];
[view removeFromSuperview];
NSLog (@ "webViewDidFinishLoad");
}
-(void) webView: (UIWebView *) webView didFailLoadWithError: (NSError *) error
{
[activityIndicator stopAnimating];
UIView * view = (UIView *) [self.view viewWithTag: 108];
[view removeFromSuperview];
</ strong >
In order to give users a more intuitive interface effect, we add the loading interface to try
to add wait in webViewDidStartLoad
Copy codecode show as below:
<strong>-(void) webViewDidStartLoad: (UIWebView *) webView
{
// Create UIActivityIndicatorView translucent View
UIView * view = [[UIView alloc] initWithFrame: CGRectMake (0, 0, 320, 480)];
[view setTag : 108];
[view setBackgroundColor: [UIColor blackColor]];
[view setAlpha: 0.5];
[self.view addSubview: view];
activityIndicator = [[UIActivityIndicatorView alloc] initWithFrame: CGRectMake (0.0f, 0.0f, 32.0f, 32.0f)];
[activityIndicator setCenter: view.center];
[activityIndicator setActivityIndicatorViewStyle: UIActivityIndicatorViewStyleWhite];
[view addSubview: activityIndicator];
[activityIndicator startAnimating];
</ strong>
When loading is completed or failed, remove the loading effect
Copy codecode show as below:
<strong>-(void) webViewDidFinishLoad: (UIWebView *) webView
{
[activityIndicator stopAnimating];
UIView * view = (UIView *) [self.view viewWithTag: 108];
[view removeFromSuperview];
NSLog (@ "webViewDidFinishLoad");
}
-(void) webView: (UIWebView *) webView didFailLoadWithError: (NSError *) error
{
[activityIndicator stopAnimating];
UIView * view = (UIView *) [self.view viewWithTag: 108];
[view removeFromSuperview];
</ strong >