-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathViewController.m
73 lines (62 loc) · 2.27 KB
/
ViewController.m
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
64
65
66
67
68
69
70
71
72
73
//
// ViewController.m
// ZBTool
//
// Created by qmap01 on 17/2/28.
// Copyright © 2017年 Zhaobin. All rights reserved.
//
#import "ViewController.h"
#import "ZBLoadingView.h"
#import "ZBDeviceTool.h"
#import "ZBPathTool.h"
#import "NSArray+SplitAry.h"
#import "ImageTool.h"
#import "ZBMathTool.h"
#import <WebKit/WebKit.h>
@interface ViewController ()
@property (nonatomic,strong) ZBLoadingView *zbloadView;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
NSNotification *info = [[NSNotification alloc]initWithName:@"gifManager" object:@[@"1",@"2"] userInfo:@{@"a":@"啊",@"b":@"哈"}];
[self.view addSubview:self.zbloadView];
[self performSelector:@selector(dismissView:) withObject:info afterDelay:10];
[ZBDeviceTool shareSingleton];
NSLog(@"%@",[ZBDeviceTool getCurrentDeviceModel]);
NSArray *ary = @[@"1",@"2",@"3",@"4",@"5",@"6",@"8",@"9",@"10",@"11",@"12"];
NSArray *new = [ary createSubAryWithsplitArraywithSubSize:2];
NSLog(@"count:%ld",new.count);
NSString* phoneModel = [[UIDevice currentDevice] model];
NSLog(@"型号: %@",phoneModel );
// [self imageFunction];
NSString *chinese = [ZBMathTool convertAmount:@"121231231356324.78"];
NSLog(@"%@",chinese);
}
- (void)dismissView:(NSNotification*)info{
NSLog(@"%@",[info.userInfo allValues]);
[_zbloadView dismissLoadingView];
_zbloadView = nil;
}
- (void)imageFunction {
ImageTool *tool = [ImageTool shareTool];
NSString *hdPath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"gif"];
NSData *data= [NSData dataWithContentsOfFile:hdPath];
double time = [tool durationForGifData:data];
FLAnimatedImageView *gifimage = [[FLAnimatedImageView alloc] initWithFrame:CGRectMake(0, 20, 100, 100)];
FLAnimatedImage *image = [FLAnimatedImage animatedImageWithGIFData:data];
gifimage.animatedImage = image;
[self.view addSubview:gifimage];
NSLog(@"GIF:%lf",time);
}
- (ZBLoadingView *)zbloadView {
if (!_zbloadView) {
_zbloadView = [[ZBLoadingView alloc]initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
}
return _zbloadView;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end