Xcode 16 + iOS 18 適配

1. 微信分享、支付不能正常使用
UIApplication.openURL(:) 被徹底禁用,使用UIApplication.open(:options:completionHandler:), 升級對應的SDK。

2. iOS 18 對 UIView的maskView 增加了斷言,導致如果業(yè)務代碼里有同名屬性可能導致觸發(fā)該斷言。

  • 自定義UIView,maskView,會崩潰
  • 自定義UIViewController與cell,maskView,不會崩潰

3. UICollectionView 閃退問題

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Expected dequeued view to be returned to the collection view in preparation for display. When the collection view's data source is asked to provide a view for a given index path, ensure that a single view is dequeued and returned to the collection view. Avoid dequeuing views without a request from the collection view. For retrieving an existing view in the collection view, use -[UICollectionView cellForItemAtIndexPath:] or -[UICollectionView supplementaryViewForElementKind:atIndexPath:].

// 錯誤:可能返回未附加到界面上的新 cell
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: "id", for: indexPath)
// 正確:獲取已存在的 cell(若在屏幕上)
let existingCell = collectionView.cellForItem(at: indexPath)

4. 選擇相冊照片功能出問題,無法看到所有照片
如果使用了ZLPhotoBrowser,更新版本,參考這里
subtype 由.albumRegular改為.any

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

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

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