单军华
2017-07-12 20d1260d26b028897f3c0935c12fc35aa37b2e93
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
53
54
55
56
57
58
59
60
61
62
63
//
//  DemoVC2.m
//  BABaseProject
//
//  Created by 博爱 on 16/5/4.
//  Copyright © 2016年 博爱之家. All rights reserved.
//
 
#import "DemoVC2.h"
#import "BAClearCacheManager.h"
#import "UIViewController+BAAlertView.h"
 
@interface DemoVC2 ()
 
@end
 
@implementation DemoVC2
 
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    
}
 
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    
}
 
- (void)viewDidLoad {
    [super viewDidLoad];
 
    [self clearCache];
}
 
- (void)clearCache
{
    BAClearCacheManager *clearCacheManager = [BAClearCacheManager ba_sharedCache];
    CGFloat cacheSize = [clearCacheManager ba_loadCacheSize];
 
    NSString *clearMessage = [NSString stringWithFormat:@"缓存大小为%.2fM确定要清理吗?", cacheSize];
 
    BA_WEAKSELF;
    [self BAAlertWithTitle:@"温馨提示:" message:clearMessage andOthers:@[@"取 消", @"确 定"] animated:YES action:^(NSInteger index)
     {
        
        if (index == 0)
        {
            return ;
        }
        if (index == 1)
        {
            [clearCacheManager ba_myClearCacheAction];
            NSString *msg = [NSString stringWithFormat:@"成功清除缓存:%.2fM",  cacheSize];
            //[weakSelf.view ba_showAlertView:@"温馨提示:" message:msg];
        }
        
    }];
    
}
 
@end