presentViewController不全屏問題
之前iOS13處理過,結(jié)果iOS18又出現(xiàn)了
解決辦法:
- (void)custompresentViewController:(UIViewController *)viewControllerToPresent animated:(BOOL)flag completion:(void (^)(void))completion{
if (@available(iOS 13.0, *)) {
// iOS13以后style默認(rèn)UIModalPresentationAutomatic,以前版本xcode沒有這個(gè)枚舉,所以只能寫-2
if (viewControllerToPresent.modalPresentationStyle == -2 || viewControllerToPresent.modalPresentationStyle == UIModalPresentationPageSheet || viewControllerToPresent.modalPresentationStyle == UIModalPresentationFormSheet ) {
viewControllerToPresent.modalPresentationStyle = UIModalPresentationOverFullScreen;
}
}
[self custompresentViewController:viewControllerToPresent animated:flag completion:completion];
}
上傳ipa包時(shí)報(bào)錯(cuò)(Asset validation failed (90482))
Asset validation failed (90482)
Invalid Executable. The executable 'xxxx.app/Frameworks/NIMSDK.framework/NIMSDK' contains bitcode. (ID: 812059a0-5027-49c1-b45a-70331f017719)
在構(gòu)建之前剝離位碼作為解決方法并更新依賴項(xiàng)作為最終解決方案??磥?Xcode 16 對位碼驗(yàn)證實(shí)施了更嚴(yán)格的規(guī)則。
解決辦法:在Podfile 末尾添加了以下幾行作為解決方法
post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['CODE_SIGN_IDENTITY'] = ''
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
#config.build_settings['GENERATE_INFOPLIST_FILE'] = "NO"
if target.name == 'NIMSDK_LITE'
`xcrun -sdk iphoneos bitcode_strip -r Pods/NIMSDK_LITE/NIMSDK/NIMSDK.framework/NIMSDK -o Pods/NIMSDK_LITE/NIMSDK/NIMSDK.framework/NIMSDK`
end
end
end
end
end
具體路徑可以通過查看想要Pods的實(shí)際路徑,通過showInFinder進(jìn)行查看
UITabBarController變化
UITabBarController 新增了一個(gè)類型為 UITabBarController.Mode 的屬性,用于設(shè)置UITabBar顯示效果,值有automatic、tabBar與tabSidebar,其中最后一種在 iPadOS 顯示時(shí),可以在 siderBar 與 tabBar 之間進(jìn)行切換。
UITabBarController 新增了一種新的標(biāo)簽類型UITab,可以設(shè)置title(標(biāo)題)、subtitle(副標(biāo)題)、image(圖片)、badgeValue(角標(biāo)值)等。
UITabBarControllerDelegate 增加了多個(gè)與UITab相關(guān)的代理方法。
注意??: 在 iPadOS上系統(tǒng)UITabBarController會移動到頂部。
UIViewController
UIViewController 新增了類型為UIViewController.Transition的屬性,可以實(shí)現(xiàn)特殊的轉(zhuǎn)場效果,分別為zoom、coverVertical、flipHorizontal、crossDissolve與partialCurl。
自定義視圖不能命名為maskView(跟系統(tǒng)的沖突了)容易造成崩潰
創(chuàng)建view時(shí)將其命名為maskview,然后addSubview時(shí)就會在iOS18上崩潰