Xcode 16 + iOS 18 适配

1. 微信分享、支付不能正常使用
UIApplication.openURL(:) 被彻底禁用,使用UIApplication.open(:options:completionHandler:), 升级对应的SDK。

2. iOS 18 对 UIView的maskView 增加了断言,导致如果业务代码里有同名属性可能导致触发该断言。

  • 自定义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

最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容