-
Notifications
You must be signed in to change notification settings - Fork 3.5k
/
Copy pathSWBWebViewContainer.h
52 lines (37 loc) · 1.32 KB
/
SWBWebViewContainer.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
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// SWBWebViewContainer.h
// AquaWeb
//
// Created by clowwindy on 11-6-16.
// Copyright 2011年 __MyCompanyName__. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "SWBWebView.h"
#define kMaxCachedWebViews 10
#define kMinCachedWebViews 2
@protocol SWBWebViewContainerDelegate <UIWebViewDelegate>
@required
-(void)webViewContainerWebViewDidCreateNew:(SWBWebView *)webView;
-(void)webViewContainerWebViewDidSwitchToWebView:(SWBWebView *)webView;
-(void)webViewContainerWebViewNeedToReload:(SWBWebView *)webView tag:(NSInteger)tag;
@end
@interface SWBWebViewContainer : UIView <UIWebViewDelegate> {
// 最旧的在0,最新的在末尾
NSMutableArray *cachedWebViews;
SWBWebView *currentWebView;
NSString *s;
}
- (void)newWebView:(NSInteger)tag;
- (void)switchToWebView:(NSInteger)tag;
- (void)closeWebView:(NSInteger)tag;
- (SWBWebView *)webViewByTag:(NSInteger)tag;
- (NSInteger)currentWebView;
- (SWBWebView *)currentSWBWebView;
// 彻底释放,适合内存严重不足
- (void)releaseBackgroundWebViews;
// 仅从superview移除,可以节省部分内存
- (void)removeBackgroundWebViewsFromSuperView;
- (NSString *)titleForWebView:(SWBWebView *)webView;
//- (void)progressEstimateChanged:(NSNotification*)theNotification;
@property (nonatomic, weak) id<SWBWebViewContainerDelegate> delegate;
@end