iOS13發(fā)生的變化

1.部分私有API使用KVC可能發(fā)生崩潰

如:[textField setValue:[UIColor blueColor] forKeyPath:@"_placeholderLabel.textColor"];
解決:訪(fǎng)問(wèn)去掉下劃線(xiàn)
[textField setValue:[UIColor blueColor] forKeyPath:@"placeholderLabel.textColor"];

2.推送的deviceToken格式發(fā)生了變化

解決:
參考友盟的做法

 #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.模態(tài)彈出默認(rèn)樣式發(fā)生變化

4.UIWebView被廢棄。

5.MPMoviePlayerController 被棄用

6.暗黑模式

由于增加了暗黑模式,需要主要字體顏色、視圖背景色的設(shè)置。比如UILabel文字顏色,如果沒(méi)有設(shè)置顏色,而是直接使用了系統(tǒng)默認(rèn)的顏色,那么當(dāng)App設(shè)置為深色,文字的顏色就是白色,當(dāng)App設(shè)置為淺色,文字的顏色就是黑色。

新增的API

'statusBarFrame' is deprecated: first deprecated in iOS 13.0 - Use the statusBarManager property of the window scene instead.(獲取狀態(tài)欄的API發(fā)生了變化)

UIWindow * window = [[UIApplication sharedApplication] windows][0];
CGFloat height = window.windowScene.statusBarManager.statusBarFrame.size.height;
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀(guān)點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容