2024年iOS开发进阶(十七):PrefixHeader(2),java dubbo面试题

更多面试题

**《350页前端校招面试题精编解析大全》**内容大纲主要包括 HTML,CSS,前端基础,前端核心,前端进阶,移动端开发,计算机基础,算法与数据结构,项目,职业发展等等

开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】

注1⚠️:因为 pch 文件在预编译后会将头文件缓存起来,再次编译时则不需要重新编译该文件中的内容,进而提升了编译速率。所以尽量不要将开发中共用性较低的文件或宏定义(宏定义可单独创建一个头文件进行存放,再将该宏文件引入至 pch)引入进 pch 文件中导致重复编译的操作,反而降低其速率使文件所带来的作用大大折扣。

注2⚠️:pch 文件的命名方式,建议以项目名称开头,例如项目名称为"TestDemo"则 pch 文件名称则为"TestDemo-Prefix",当然实际命名以用途为准。

.pch文件示例如下:

//
// Hello-Header.pch
//

#ifndef Hello\_Header\_pch
#define Hello\_Header\_pch

#define WEAKSELF typeof(self) \_\_weak weakSelf = self;
#define STRONGSELF typeof(self) \_\_strong strongSelf = self;
#define STRONGSELFFor(object) typeof(object) \_\_strong strongSelf = object;
#define kScreen [UIScreen mainScreen].bounds.size
#define kScreenWidth [UIScreen mainScreen].bounds.size.width
#define kScreenHeight [UIScreen mainScreen].bounds.size.height
#define HexCorlor(hexValue) [UIColor colorWithRed:((float)((hexValue & 0xFF0000) >> 16)) / 255.0 green:((float)((hexValue & 0xFF00) >> 8)) / 255.0 blue:((float)(hexValue & 0xFF)) / 255.0 alpha:1.0]

#define DEFAULTFRAME CGRectMake(0, 0, 1, 1)
#define BIGHEIGHT kScreen.width\*9/16
#define SMALLHEIGHT (kScreen.width/2)\*9/16

#define is\_iPhoneXSerious ({\
BOOL isPhoneX = NO;\
if (@available(iOS 11.0, \*)) {\
 UIWindow \*window = [[UIApplication sharedApplication].windows firstObject];\
 isPhoneX = window.safeAreaInsets.bottom > 0;\
}\
isPhoneX;\
})


#define is\_portrait ({\
BOOL is\_portrait = NO;\
UIInterfaceOrientation orientation = [UIApplication sharedApplication].statusBarOrientation;\
is\_portrait = !UIInterfaceOrientationIsLandscape(orientation);\
is\_portrait;\
})

#define STATUS\_BAR\_HEIGHT (is\_iPhoneXSerious ? 44.f : 20.f)

#define NAVIGATION\_BAR\_HEIGHT (is\_iPhoneXSerious ? 88.f : 64.f)

#define TAB\_BAR\_HEIGHT (is\_iPhoneXSerious ? (49.f+34.f) : 49.f)

#define HOMEINDICATOR\_HEIGHT (is\_iPhoneXSerious ? 34.f : 0)

#define KViewRadius(View, Radius)\
\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES];\
[View.layer setShouldRasterize:YES];\
[View.layer setRasterizationScale:[UIScreen mainScreen].scale];

#define KViewBorderRadius(View, Radius, Width, Color)\
\
[View.layer setCornerRadius:(Radius)];\
[View.layer setMasksToBounds:YES];\
[View.layer setShouldRasterize:YES];\
[View.layer setRasterizationScale:[UIScreen mainScreen].scale];\
[View.layer setBorderWidth:(Width)];\
[View.layer setBorderColor:[Color CGColor]];

// notifacation
#define K\_NOTIC\_CENTER [NSNotificationCenter defaultCenter]
#define K\_Notic\_LogOutNative @"K\_Notic\_LogOutNative"
#define K\_Notic\_LoginSuccess @"K\_Notic\_LoginSuccess"

// 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 <XYRTCEngine/NemoSDK.h>
#import <BPUIBaseComponents/BPBaseToastView.h>
#import <BPUIBaseComponents/BPBaseToastViewConfig.h>
#import "Masonry.h"

//#import "AppDelegate.h"
#import "XYConferenceHintView.h"
#import "XYAlertView.h"
#import "XYLocalString.h"

#import "XYFloatingManager.h"
#import "XYSDKManager.h"
#import "XYLayoutManager.h"

#import "UIView+XYFrame.h"
#import "UIColor+XYColor.h"
#import "NSDictionary+Utils.h"
#import "UIView+GradientView.h"
#import "UIView+Orientation.h"

#import "Masonry.h"
#import "XYHUDManager.h"

#define Font(key) BOCSystemFont((key))

#endif /\* Hello\_Header\_pch \*/


四、拓展阅读

最后

资料过多,篇幅有限

开源分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】

自古成功在尝试。不尝试永远都不会成功。勇敢的尝试是成功的一半。

分享:【大厂前端面试题解析+核心总结学习笔记+真实项目实战+最新讲解视频】](https://bbs.csdn.net/forums/4304bb5a486d4c3ab8389e65ecb71ac0)**

自古成功在尝试。不尝试永远都不会成功。勇敢的尝试是成功的一半。

  • 5
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值