GiGaMaskTime/GIGA/Config/GIGA.h

124 lines
5.0 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// 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 kUserRegistSucccess @"userRegistSuccess"
//登录成功
#define kUserLoginSuccessNoti @"gigaUserloginSuccess"
//退出登录
#define kUserLogOutNotify @"userLogOutNotify"
//用户头像修改
#define kUserAvatorUpdateNoti @"userAvatorUpdate"
//用户昵称修改
#define kUserNameUpDateNoti @"userNickNameUpdate"
//分享成功
#define NC_UseShareSuccessNoti @"GIGaUsershareSuccess"
//微信登陆授权成功
#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 & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.f]
#define GIGA_MAIN_BGCOLOR [UIColor colorWithRed:131/255.0f green:10/255.0f blue:10/255.0f alpha:1]
#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];
#define GIGA_WIndowTost(__toast__) [[UIApplication sharedApplication].keyWindow makeToast:(__toast__) duration:1.5 position:CSToastPositionCenter];
//X
//底部工具栏需要为home indicator留出34pt边距
#define PhoneX_BottomMargin ([[UIApplication sharedApplication] statusBarFrame].size.height == 44.0 ? 34.0 :0.0)
//状态栏高度由20pt变成44pt导航栏以上变化64->88。
#define PhoneX_TopMargin ([[UIApplication sharedApplication] statusBarFrame].size.height == 44.0 ? 24.0 :0.0)
// 状态栏高度 所有机型
#define Phone_STATUBAR_H [[UIApplication sharedApplication] statusBarFrame].size.height
//状态栏—➕导航栏
#define SAFE_NAV_HEIGHT ([[UIApplication sharedApplication] statusBarFrame].size.height == 44.0 ? 88.0 : 64.0)
#define GIGA_FONTNAME @"PingFangSC-Medium"
#define GIGA_FONTBOLD @"PingFangSC-Semibold"
#define GIGA_TEXTFONTBOLD(font) [UIFont fontWithName:GIGA_FONTBOLD size:font]
#define GIGA_TEXTFONTMEDIUM(font) [UIFont fontWithName:GIGA_FONTNAME size:font]
//国际化
#define GIGALocalComm(key) NSLocalizedStringFromTable(key, @"GIGACommonLocalizabe", nil)
//个人中心
#define GIGALocalUser(key) NSLocalizedStringFromTable(key, @"GIGAUserLocalizable", nil)
//HUD
#define HUD_DISPLAY_DURATION 2
#define HUD_TIMEOUT_DURATION 8
//分享图片文件名
#define kUSERSHAREA_IMAGENAME @"mask_share"
#endif /* GIGA_h */