forked from millenomi/muikit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
L0WebViewController.h
39 lines (28 loc) · 1.5 KB
/
L0WebViewController.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//
// MvrWebViewController.h
// MuiKit
//
// Created by ∞ on 13/10/09.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
/*
This class manages a UIWebView, deallocating it when not shown to limit RAM use.
The view this controller manages is a regular UIView (or whatever you shove into its .view outlet if you use a nib). When appearing, it will produce a web view and add it to the hierarchy through its -insertWebViewAsSubview method. The web view will be removed when the view disappears, and readded on demand later. (This instance is also automatically the web view's delegate for convenience.)
*/
@interface L0WebViewController : UIViewController <UIWebViewDelegate> {
UIWebView* webView;
NSURL* initialURL;
}
- (id) init; // calls initWithNibName:nil bundle:nil and sets up things to use a default UIView as self.view.
// is nil before viewWillAppear: and becomes nil again after viewDidDisappear:.
@property(readonly, retain) UIWebView* webView;
// if non-nil, the web view will be instructed to navigate here whenever it's created.
@property(copy) NSURL* initialURL;
// override points:
@property(readonly) CGRect webViewFrame; // The frame the web view will have on add. Default = self.view's bounds.
- (void) insertWebViewAsSubview; // Adds the web view to the hierarchy. The default is to add through addSubview: of self.view.
@property(readonly) BOOL webViewAutoresizes; // if YES, the web view will be set to flexible width and height.
@end
#endif