萤石云 iOSSDK,移植跨平台相关工程
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
//
//  Constants.h
//  SDKDemo
//
//  Created by  Tim Lei on 10/13/15.
//  Copyright © 2015 FreeView. All rights reserved.
//
 
#import <Foundation/Foundation.h>
//#import "NSBundle+HDLEZ.h"
 
// 日志输出
#ifdef DEBUG
#define HDLEZLog(fmt, ...)         NSLog((@"- HDLEZSDK: " fmt), ##__VA_ARGS__)
#else
#define HDLEZLog(...)
#endif
 
//国际化语言
#define HDLEZLocallizedString(x, ...)             NSLocalizedString(x, nil)
 
/* Default Font Name */
#define HDLEZ_App_Default_Font_Name   @"Helvetica Neue"
 
/* NavigationBar Style */
#define HDLEZ_NavigationBar_Bar_Tint_Color    [UIColor colorWithHex:0x3C6DD2 alpha:1.0]
#define HDLEZ_NavigationBar_Tint_Color    [UIColor colorWithHex:0xFFFFFF alpha:1.0]
#define HDLEZ_NavigationBar_Foreground_Color   [UIColor colorWithHex:0xFFFFFF alpha:1.0]
#define HDLEZ_NavigationBar_Title_Shadow_Color    [UIColor colorWithHex:0x0 alpha:1.0]
#define HDLEZ_NavigationBar_Title_Font_Size   18.0
 
#define HDLEZ_APP_SCREEN_BOUNDS   [[UIScreen mainScreen] bounds]
#define HDLEZ_IPhoneX ([UIApplication sharedApplication].statusBarFrame.size.height >= 44)
#define HDLEZ_APP_SCREEN_HEIGHT   (HDLEZ_APP_SCREEN_BOUNDS.size.height)
#define HDLEZ_APP_SCREEN_WIDTH    (HDLEZ_APP_SCREEN_BOUNDS.size.width)
#define HDLEZ_APP_TOP_BAR_HEIGHT    (HDLEZ_IPhoneX ? 88 : 64)
#define HDLEZ_APP_STATUS_BAR_HEIGHT (HDLEZ_IPhoneX ? 44 : 20)
#define HDLEZ_APP_TAB_BOTTOM_HEIGHT (HDLEZ_IPhoneX ? 34 : 0)
 
#define HDLEZHEXCOLOR(rgbValue, a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16)) / 255.0 green:((float)((rgbValue & 0xFF00) >> 8)) / 255.0 blue:((float)(rgbValue & 0xFF)) / 255.0 alpha:a]
 
#define HDLEZRGBCOLOR(r,g,b,a) [UIColor colorWithRed:(r)/255 green:(g)/255 blue:(b)/255 alpha:a]
 
// Design Width&Height
#define HDLEZDesignWidth 375
#define HDLEZDesignHeight 667
#define HDLEZGetRealWidth(W)  W / (HDLEZDesignWidth * 1.0f / APP_SCREEN_WIDTH)
#define HDLEZGetRealHeight(H)  H / (HDLEZDesignHeight * 1.0f / APP_SCREEN_HEIGHT)
 
 
// 字体颜色*
 
#define HDLEZ_COLOR_TITLE_BLACK HDLEZHEXCOLOR(0x1B2D4D,1.0)
 
 
#define HDLEZ_COLOR_TEXT HDLEZHEXCOLOR(0x333333,1.0)
#define HDLEZ_COLOR_TEXT_HIGLIGHT HDLEZHEXCOLOR(0xFB744A,1.0)
#define HDLEZ_COLOR_TEXT_WHITE HDLEZHEXCOLOR(0xFFFFFF,1.0)
#define HDLEZ_COLOR_TEXT_ORANGE HDLEZHEXCOLOR(0xFC744B,1.0)
#define HDLEZ_COLOR_TEXT_GRAY HDLEZHEXCOLOR(0x666666,1.0)
#define HDLEZ_COLOR_TEXT_LIGHT_GRAY HDLEZHEXCOLOR(0xC0C7D4,1.0)
#define HDLEZ_COLOR_TEXT_DETAIL_GRAY HDLEZHEXCOLOR(0x999999,1.0)
#define HDLEZ_COLOR_TEXT_LIGHT_BLUE HDLEZHEXCOLOR(0x4484F4,1.0)
#define HDLEZ_COLOR_TEXT_TITLE_GRAY HDLEZHEXCOLOR(0x1B2D4D,1.0)
#define HDLEZ_COLOR_TEXT_INPUT_GRAY HDLEZHEXCOLOR(0xA5AEBC,1.0)
#define HDLEZ_COLOR_TEXT_INPUT_PLACEHOLD_GRAY HDLEZHEXCOLOR(0xC0C7D4,1.0)
#define HDLEZ_COLOR_TEXT_BUTTON_GRAY HDLEZHEXCOLOR(0x798394,1.0)
 
 
 
//背景颜色
#define HDLEZ_COLOR_NAV_BACKGROUND HDLEZHEXCOLOR(0xF7F7F7,1.0) //导航栏背景颜色
#define HDLEZ_COLOR_VIEW_BACKGROUND HDLEZHEXCOLOR(0xF2F3F7,1.0) //后视图背景颜色
#define HDLEZ_COLOR_VIEW_FOREGROUND HDLEZHEXCOLOR(0xFFFFFF,1.0) //前视图背景颜色
#define HDLEZ_COLOR_BACKGROUND_GRAY HDLEZHEXCOLOR(0x000000,0.4) //灰色背景颜色
#define HDLEZ_COLOR_BACKGROUND_BLACK HDLEZHEXCOLOR(0x232323,1.0) //黑色背景颜色
#define HDLEZ_COLOR_BACKGROUND_ORANGE HDLEZHEXCOLOR(0xFC744B,1.0) //橙色背景颜色
#define HDLEZ_COLOR_BACKGROUND_IMAGE HDLEZHEXCOLOR(0xE9E9E9,1.0) //图片背景颜色
#define HDLEZ_COLOR_BACKGROUND_BUTTON HDLEZHEXCOLOR(0x4484F4,1.0) //按钮背景颜色
#define HDLEZ_COLOR_BACKGROUND_BUTTON_GRAY HDLEZHEXCOLOR(0xC0C7D4,1.0) //按钮灰背景颜色
#define HDLEZ_COLOR_BACKGROUND_LINE HDLEZHEXCOLOR(0xECEDEE,1.0) //下划线背景颜色
#define HDLEZ_COLOR_BACKGROUND_LINE_RED HDLEZHEXCOLOR(0xFF5757,1.0) //线背景红颜色
 
 
//字体大小
 
#define HDLEZ_FontSize_15 15   //  小标题字号 15
#define HDLEZ_FontSize_16 16   //  小标题字号 16
#define HDLEZ_FontSize_12 12   //  小标题字号 12
#define HDLEZ_FontSize_10 10   //  小标题字号 10
#define HDLEZ_FontSize_14 14   //  小标题字号 14
#define HDLEZ_FontSize_24 24   //  小标题字号 24
#define HDLEZ_FontSize_18 18   //  小标题字号 18
#define HDLEZ_FontSize_26 26   //  小标题字号 26
 
#define HDLEZ_APP_UIFont            @"PingFangSC-Regular"//苹方-简 常规体
#define HDLEZ_APP_UIFont_BOLD       @"PingFangSC-Semibold"//苹方-简 中粗体
#define HDLEZ_APP_UIFont_Medium       @"PingFangSC-Medium"//苹方-简 中黑体
 
#define HDLEZ_Get_FontMediumWithSize(s) [UIFont fontWithName:HDLEZ_APP_UIFont_Medium size:s]
#define HDLEZ_Get_FontRegularWithSize(s) [UIFont fontWithName:HDLEZ_APP_UIFont size:s]
#define HDLEZ_Get_FontBoldWithSize(s) [UIFont fontWithName:HDLEZ_APP_UIFont_BOLD size:s]
 
 
 
// 创建临时密码通知
#define HDLEZNotificationChangeTemP  @"hdlEZNotificationChangeTemP"
 
//// 人脸信息变化通知事件d
//#define HDLEZNotificationChangeFace  @"hdlNotificationChangeFace"
//
//// 通话结束通知
//#define HDLF_FV_NF_END_CALL  @"hdlNotificationEndCall"
//
//// 通话开始通知
//#define HDLF_FV_NF_BEGIN_CALL  @"hdlNotificationBeginCall"
//
//
//// 通话类型
//#define HDLF_FV_CALL_TYPE_KEY  @"HDLEZCallTypeKey"
 
//萤石门锁spk
#define HDLEZ_DOOR_SPK  @"security.door.ezviz"
 
 
//设备类型
typedef enum {
    HDLEZDeviceType_Default=0, //默认类型
    HDLEZDeviceType_Door=1,//门锁
}HDLEZDeviceType;
 
 
@interface HDLEZConstants : NSObject
/*获取当前controller
 */
+(UIViewController *)currentVC;
 
/*获取当前window
 */
+(UIWindow*)appWindow;
 
/*截图
 */
+(UIImage *)captureImageFromView:(UIView *)view;
 
/*保存图片到相册
 */
+(void)saveImageToPhotosAlbum:(UIImage *)savedImage;
 
/**
 *  生成二维码
 */
+ (UIImage *)creatCIQRCodeImage:(NSString *)dataStr;
 
/*获取特定时间格式的时间字符串
 */
+(NSString *)timeStrWithFormate:(NSString *)formate data:(NSDate *)date;
 
/**
 计算文字高度,允许换行计算
 
 @param fontSize 文字大小
 @param widht 文字宽度
 @param text 文字内容
 @return 返回文字的高度
 */
+(CGFloat)sizeLineFeedWithFont:(CGFloat)fontSize textSizeWidht:(CGFloat)widht text:(NSString*)text;
 
 
 
/**
 *  保存数据
 */
+ (void)saveObject:(id )obj key:(NSString*)key;
 
/**
 *  获取数据
 */
+ (id)getObjectBykey:(NSString*)key;
 
/*小于两位数前面自动填补0
 */
+(NSString *)autoFillZero:(NSInteger)value;
 
 
/*时间对比
 */
+ (int)compareOneDay:(NSDate *)oneDay withAnotherDay:(NSDate *)anotherDay;
 
/*时间格式转换
 */
+(NSString *)turnDateString:(NSString*)dateString toFormater:(NSString*)formater;
 
 
/*判断是否为纯数字
 @param number 内容
 */
+(BOOL)validateNumber:(NSString*)number;
 
/* 将nil转为""
 */
+(NSString*)turnNil:(NSString *)str;
@end