Files
yinmeng-ios/xplan-ios/Base/Base.pch

64 lines
2.2 KiB
Plaintext
Raw Normal View History

2021-09-06 18:47:38 +08:00
//
// Base.pch
// xplan-ios
//
// Created by zu on 2021/9/1.
//
#ifndef Base_pch
#define Base_pch
// Include any system framework and library headers here that should be included in all compilation units.
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
#import <UIKit/UIKit.h>
#define AppName ([[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleDisplayName"])
//iPhoneX系列设备(刘海屏设备)
#define iPhoneXSeries \
({BOOL isPhoneXSeries = NO;\
if (@available(iOS 11.0, *)) {\
isPhoneXSeries = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\
}\
(isPhoneXSeries);})
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
/// 默认主题色
#define ThemeDefaultColor UIColorFromRGB(0x248CFE)
/// 页面背景色
#define ThemeBackgroundColor UIColorFromRGB(0x1C1B22)
/// 字体默认颜色
#define ThemeTextColor UIColorFromRGB(0xC6C6E9)
/// 字体默认颜色
#define ThemeTextSecondColor UIColorFromRGB(0x4F516A)
/// 按钮渐变色 start
#define ThemeButtonGradientStartColor UIColorFromRGB(0x218EFF)
/// 按钮渐变色 end
#define ThemeButtonGradientEndColor UIColorFromRGB(0x7727E4)
#define KScreenWidth [[UIScreen mainScreen] bounds].size.width
#define KScreenHeight [[UIScreen mainScreen] bounds].size.height
#define statusbarHeight [[UIApplication sharedApplication] statusBarFrame].size.height
#define kStatusBarHeight statusbarHeight
#define kSafeAreaBottomHeight (iPhoneXSeries ? 34 : 0)
#define kSafeAreaTopHeight (iPhoneXSeries ? 24 : 0)
#define kNavigationHeight (kStatusBarHeight + 44)
#define kTabBarHeight (iPhoneXSeries ? 49.0+34.0 : 49.0)
#ifdef DEBUG
#define NSLog(fmt,...) NSLog((@"%s [Line %d]" fmt),__PRETTY_FUNCTION__,__LINE__,##__VA_ARGS__)
#else
#define NSLog(...)
#endif
#define isEnterprise \
({BOOL isEnterprise = NO;\
if (@available(iOS 11.0, *)) {\
NSString *bundleID = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];\
isEnterprise = [bundleID isEqualToString:@"com.yinyou.enterprise.ios"];\
}\
(isEnterprise);})
#endif /* Base_pch */