工作中常用的方法封装
//例如:
view.height
view.width
view.left
view.top
view.right
view.bottom
view.centerX
view.centerY
view.size
view.origin
//导入YGDeviceSpaceTool.h
/** 计算本机剩余存储空间 **/
+ (long long)deviceFreeSpace;
/** 外界传入一个size,判断本机空闲空间是否足够 **/
+ (BOOL)deviceSpaceIsEnough:(long long)size;
/** 判断文件是否加密过 **/
+ (BOOL)isFileEncry:(NSString *)filePath;
/** 给文件加密 **/
+ (void)encryFile:(NSString *)filePath;
/** 给加密过的文件追加后缀 **/
+ (void)appendSuffixToFile:(NSString *)filePath;
/** 给文件解密 **/
+ (void)descryFile:(NSString *)filePath;
- (UIImage *)getImageFromView {
CGFloat scale = [UIScreen mainScreen].scale;
UIGraphicsBeginImageContextWithOptions(self.lw_size, NO, scale);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
return image;
}
调用方法:
[LWWindowAlert enableCustomWindowAlert];
如果不想要,调用下面:
[LWWindowAlert disableCustomWindowAlert];