Visual_Novel_iOS/crush/Crush/Src/Utils/CommonDefine.h

45 lines
1.4 KiB
C
Raw Normal View History

2025-10-09 10:29:35 +00:00
//
// CommonDefine.h
// LegendTeam
//
// Created by 梁博 on 13/12/21.
//
#ifndef CommonDefine_h
#define CommonDefine_h
// 给OC代码用的宏定义
#define WeakSelf autoreleasepool{} __weak typeof(self) weakSelf = self
#define StrongSelf autoreleasepool{} __strong typeof(self) self = weakSelf
#define ScreenWidth [UIScreen mainScreen].bounds.size.width
#define ScreenHeight [UIScreen mainScreen].bounds.size.height
#define StatusBarHeight UIWindow.statusBarHeight
#define NavigationBarHeight 44.f
#define StatusAndNaviBarHeight (StatusBarHeight + NavigationBarHeight)
#define BottomInset UIWindow.safeAreaBottom
#define TabBarTotalHeight UIWindow.tabBarTotalHeight
/// 获取本地字符串
static NSString *const tableName = @"Localizable";
#define LSF(key) [OCLanuagesUtils localizedWithKey:key tableName:tableName arguments:nil]
#define LSFA(key,arguments) [OCLanuagesUtils localizedWithKey:key tableName:tableName arguments:arguments]
#ifndef __OPTIMIZE__
#define DLog(...) NSLog(__VA_ARGS__);
#define RLog(...) NSLog(__VA_ARGS__)
#else
#define DLog(...)
#define RLog(...) NSLog(__VA_ARGS__)
#endif
#define StrNoneNull(s) (s ?: @"")
#define TabBarInset BottomInset
#define kBackgroundColor(x) [UIColor colorWithRed:18/255.0 green:14/255.0 blue:27/255.0 alpha:x]
#endif /* CommonDefine_h */