iOS13发生的变化

1.部分私有API使用KVC可能发生崩溃

如:[textField setValue:[UIColor blueColor] forKeyPath:@"_placeholderLabel.textColor"];
解决:访问去掉下划线
[textField setValue:[UIColor blueColor] forKeyPath:@"placeholderLabel.textColor"];

2.推送的deviceToken格式发生了变化

解决:
参考友盟的做法

 #include <arpa/inet.h>
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
if (![deviceToken isKindOfClass:[NSData class]]) return;
const unsigned *tokenBytes = (const unsigned *)[deviceToken bytes];
NSString *hexToken = [NSString stringWithFormat:@"%08x%08x%08x%08x%08x%08x%08x%08x",
                      ntohl(tokenBytes[0]), ntohl(tokenBytes[1]), ntohl(tokenBytes[2]),
                      ntohl(tokenBytes[3]), ntohl(tokenBytes[4]), ntohl(tokenBytes[5]),
                      ntohl(tokenBytes[6]), ntohl(tokenBytes[7])];
NSLog(@"deviceToken:%@",hexToken);
}

3.模态弹出默认样式发生变化

4.UIWebView被废弃。

5.MPMoviePlayerController 被弃用

6.暗黑模式

由于增加了暗黑模式,需要主要字体颜色、视图背景色的设置。比如UILabel文字颜色,如果没有设置颜色,而是直接使用了系统默认的颜色,那么当App设置为深色,文字的颜色就是白色,当App设置为浅色,文字的颜色就是黑色。

新增的API

'statusBarFrame' is deprecated: first deprecated in iOS 13.0 - Use the statusBarManager property of the window scene instead.(获取状态栏的API发生了变化)

UIWindow * window = [[UIApplication sharedApplication] windows][0];
CGFloat height = window.windowScene.statusBarManager.statusBarFrame.size.height;
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容