iOS18 適配

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、tabBartabSidebar,其中最后一種在 iPadOS 顯示時(shí),可以在 siderBartabBar 之間進(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上崩潰

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

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

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