80 lines
3.2 KiB
C
80 lines
3.2 KiB
C
//
|
|
// GIGA.h
|
|
// GIGA
|
|
//
|
|
// Created by lianxiang on 2018/8/13.
|
|
// Copyright © 2018年 com.giga.ios. All rights reserved.
|
|
//
|
|
|
|
#ifndef GIGA_h
|
|
#define GIGA_h
|
|
|
|
#define UD_STADARDUD [NSUserDefaults standardUserDefaults]
|
|
|
|
#define UD_REMOVE_KEY(__KEY__) \
|
|
[[NSUserDefaults standardUserDefaults] removeObjectForKey:__KEY__]; \
|
|
UD_SYNC
|
|
|
|
#define UD_GET_VALUE(__KEY__) [[NSUserDefaults standardUserDefaults] valueForKey:__KEY__];
|
|
|
|
#define UD_SET_KEY_VALUE(__KEY__, __VALUE__) \
|
|
[[NSUserDefaults standardUserDefaults] setValue:(__VALUE__) forKey:(__KEY__)]; \
|
|
UD_SYNC
|
|
|
|
#define UD_SYNC [[NSUserDefaults standardUserDefaults] synchronize];
|
|
|
|
// MARK: NotificationCenter - Add
|
|
|
|
#define NC_ADD_TARGET_NAME_OBJECT(__target__, __sel__, __name__, __object__) [[NSNotificationCenter defaultCenter] addObserver:(__target__) selector:(__sel__) name:(__name__) object:(__object__)];
|
|
#define NC_POST_NAME_OBJECT(__name__,__object__) [[NSNotificationCenter defaultCenter] postNotificationName:(__name__) object:(__object__)];
|
|
|
|
#define NC_REMOVE_NAME(__target__,__name__,__object__) [[NSNotificationCenter defaultCenter] removeObserver:(__target__) name:(__name__) object:(__object__)];
|
|
|
|
// MAKR: Noti Names
|
|
#define USER_GUARD_DISSMISS @"userGaurdDissmiss"
|
|
#define APP_GUARD_DISSMISS @"APPGaurdDissmiss"
|
|
//adView
|
|
#define APP_PUSHTO_DETAILVIEW @"appPushToDetailAdView"
|
|
//面膜时间结束
|
|
#define kLOCALNotifiID_MASKETIMEEND @"GIGALocalNotificationMaskTimeEnd"
|
|
#define kUserNoti_MASKEND @"maskTimeEnd"
|
|
|
|
//app 挂起
|
|
#define kLOCALNotifiID_APPTERMINAL @"GIGALocalNotificationAppTerminal"
|
|
//微信登陆授权成功
|
|
#define kWeiXinAuthrization_Success @"WXAuthSuccess"
|
|
#define WXin_APPID @"wx1fa33defa5cbc8dd"
|
|
#define WXin_APPSecret @"3c03917b01f74a7f2d8a9bdd64f40697"
|
|
|
|
#define GIGARGB(R,G,B,A) [UIColor colorWithRed:R/255.0f green:G/255.0f blue:B/255.0f alpha:A]
|
|
#define GIGAUIColorFromRGB_A(rgbValue,alphaValue) [UIColor \
|
|
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
|
|
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
|
|
blue:((float)(rgbValue & 0xFF))/255.0 alpha:alphaValue]
|
|
|
|
#define GIGAUIColorFromRGBA(rgbValue) [UIColor \
|
|
colorWithRed:((float)((rgbValue & 0xFF000000) >> 24))/255.0 \
|
|
green:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
|
|
blue:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
|
|
alpha:((float)(rgbValue & 0xFF))/255.0]
|
|
|
|
|
|
#define SCREEN [UIScreen mainScreen]
|
|
#define WIDTH self.view.frame.size.width
|
|
#define HEIGHT self.view.frame.size.height
|
|
#define KMainW [UIScreen mainScreen].bounds.size.width
|
|
#define KMainH [UIScreen mainScreen].bounds.size.height
|
|
|
|
#define ISIOS8 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0 ? YES : NO)
|
|
#define ISIOS9 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9.0 ? YES : NO)
|
|
#define ISIOS10 ([[[UIDevice currentDevice] systemVersion] floatValue] >= 10.0 ? YES : NO)
|
|
|
|
#define weakify(var) __weak typeof(var) weakSelf = var
|
|
#define strongify(var) __strong typeof(var) strongSelf = var
|
|
|
|
#define textFontWeightSize(X,W) [UIFont systemFontOfSize:X *([UIScreen mainScreen].bounds.size.width / 320.0) weight:W]
|
|
|
|
#define GIGA_ShowToast(__toast__) [self.view makeToast:(__toast__) duration:1.5 position:CSToastPositionCenter];
|
|
|
|
#endif /* GIGA_h */
|