iOS13 适配
2019-09-28 本文已影响0人
iVikings
-
modalPresentationStyle默认是UIModalPresentationPageSheet,根据自身实际情况,可修改成UIModalPresentationFullScreenif (@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]; } }