text: //
  //  PACCommonmacro.h
  //  PACCommonMacro
  //
  //  Created by Mr. Chen on 2018/4/16.
  //  Copyright © 2018年 STPACS. All rights reserved.
  //
  
  #ifndef PACCommonmacro_h
  #define PACCommonmacro_h
  //常用宏定义
  
  #define SCREEN_WIDTH   [UIScreen mainScreen].bounds.size.width
  #define SCREENH_HEIGHT [UIScreen mainScreen].bounds.size.height
  
  #define PACRandomColor [UIColor colorWithRed:arc4random_uniform(256)/255.0 green:arc4random_uniform(256)/255.0 blue:arc4random_uniform(256)/255.0 alpha:1.0]
  
  #ifdef DEBUG
  #define PACLog(...) NSLog(@"%s 第%d行 \n %@\n\n",__func__,__LINE__,[NSString stringWithFormat:__VA_ARGS__])
  #else
  #define PACLog(...)
  #endif
  
  //弱引用/强引用
  #define PACWeakSelf(type)  __weak typeof(type) weak##type = type;
  #define PACStrongSelf(type)  __strong typeof(type) type = weak##type;
  
  //判断是否 Retina屏、设备是否iPhone 5、是否是iPad
  #define Is_Retina ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)
  
  /** 判断是否为iPhone */
  #define Is_iPhone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
  
  /** 判断是否是iPad */
  #define Is_iPad (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
  
  /** 判断是否为iPod */
  #define Is_iPod ([[[UIDevice currentDevice] model] isEqualToString:@"iPod touch"])
  
  /** 设备是否为iPhone 4/4S 分辨率320x480，像素640x960，@2x */
  #define iPhone4 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 960), [[UIScreen mainScreen] currentMode].size) : NO)
  
  /** 设备是否为iPhone 5C/5/5S 分辨率320x568，像素640x1136，@2x */
  #define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
  
  /** 设备是否为iPhone 6 分辨率375x667，像素750x1334，@2x */
  #define iPhone6 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(750, 1334), [[UIScreen mainScreen] currentMode].size) : NO)
  
  /** 设备是否为iPhone 6 Plus 分辨率414x736，像素1242x2208，@3x */
  #define iPhone6P ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO)
  
  //获取图片资源
  #define GetImage(imageName) [UIImage imageNamed:imageName]
  //读取本地图片
  #define Load_Image(file,ext) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle]pathForResource:file ofType:ext]]
  
  #define IOS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue]
  #define CurrentSystemVersion ([[UIDevice currentDevice] systemVersion])
  #define CurrentLanguage ([[NSLocale preferredLanguages] objectAtIndex:0])
  
  /** 获取系统版本 */
  #define iOS_VERSION ([[[UIDevice currentDevice] systemVersion] floatValue])
  #define CurrentSystemVersion ([[UIDevice currentDevice] systemVersion])
  
  /** 是否为iOS6 */
  #define iOS6 (([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0) ? YES : NO)
  
  /** 是否为iOS7 */
  #define iOS7 (([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) ? YES : NO)
  
  /** 是否为iOS8 */
  #define iOS8 (([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) ? YES : NO)
  
  /** 是否为iOS9 */
  #define iOS9 (([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0) ? YES : NO)
  
  //存储对象
  
  #define UserDefaultSetObjectForKey(__VALUE__,__KEY__) \
  {\
  [[NSUserDefaults standardUserDefaults] setObject:__VALUE__ forKey:__KEY__];\
  [[NSUserDefaults standardUserDefaults] synchronize];\
  }
  //获得存储的对象
  #define UserDefaultObjectForKey(__KEY__)  [[NSUserDefaults standardUserDefaults] objectForKey:__KEY__]
  
  //     删除对象
  #define UserDefaultRemoveObjectForKey(__KEY__) \
  {\
  [[NSUserDefaults standardUserDefaults] removeObjectForKey:__KEY__];\
  [[NSUserDefaults standardUserDefaults] synchronize];\
  }
  
  /** 获取temp,沙盒Document,沙盒Cache目录*/
  #define PAC_PATH_TEMP        NSTemporaryDirectory()
  #define PAC_PATH_DOCUMENT    [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]
  #define PAC_PATH_CACHE       [NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject]
  
  //获取当前语言
  #define PACCurrentLanguage ([[NSLocale preferredLanguages] objectAtIndex:0])
  
  #define kStrFormat(str,...) [NSString stringWithFormat:str,##__VA_ARGS__]
  
  #endif /* PACCommonmacro_h */
  