@interface Web_ViewViewController : UIViewController <UIWebViewDelegate> {
UIWebView *web;
BOOL firstLoad;
}
@property (nonatomic, retain) IBOutlet UIWebView *web;
@end
...
(void)viewDidLoad {
[super viewDidLoad];
firstLoad = YES;
web.delegate = self;
web.alpha = 0.0;
NSURL *clUrl = [NSURL URLWithString:@"http://www.apple.com"];
NSURLRequest *req = [NSURLRequest requestWithURL:clUrl];
[web loadRequest:req];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView {
if (firstLoad) {
firstLoad = NO;
[UIView beginAnimations:@"web" context:nil];
web.alpha = 1.0;
[UIView commitAnimations];
}
} 123
