iOS13 适配
2019-09-28 本文已影响0人
iVikings
-
modalPresentationStyle
默认是UIModalPresentationPageSheet
,根据自身实际情况,可修改成UIModalPresentationFullScreen
if (@available(iOS 13.0, *)) { viewController.modalPresentationStyle = UIModalPresentationFullScreen; }
-
warning -
Launch image are deprecated in iOS13.0. Use a launch storyboard or XIB instead
- 删除
Assets.xcassets
中的LaunchImage
文件夹 -
TARGETS
->General
->App Icons and Launch Images
->Launch Screen File
->LaunchScreen
-
Build Settings
- >Asset Catalog Launch Image Set Name
删除LaunchImage
- 删除
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME
-
LaunchScreen.storyboard
中的 image 放工程目录下
,不要放Assets.xcassets
目录
- 删除
-
若还没适配
暗黑模式
,可在info.plist
中添加UIUserInterfaceStyle
值设置为Light
-
获取
DeviceToken
方式变化- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken { if (![deviceToken isKindOfClass:[NSData class]]) return; NSMutableString *hexToken = [NSMutableString string]; const char *bytes = deviceToken.bytes; NSInteger count = deviceToken.length; for (NSInteger i = 0; i < count; i++) { [hexToken appendFormat:@"%02x", bytes[i]&0x000000FF]; } }