1.晋级xcode 14.0.1 之后首要便是运转旧项目奔溃

xcode 14.0.1 版别打包会出现部分问题。所以xcode 14.1 版别现已上线,听说修复好了部分问题。还没有晋级,也没有尝试。

运转报错运转遇到的报错 “error: Signing for “XX” requires a development team.”

推荐解决办法 直接pod 配置

iOS 16 适配问题记录

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.respond_to?(:product_type) and target.product_type == "com.apple.product-type.bundle"
      target.build_configurations.each do |config|
          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
      end
    end
  end
end

2.xcode14打出来的包多了一些体系库在iOS 12.2 一下的版别直接奔溃

xcode 14 导出的新包后,打开就溃散,但是在体系版别高的手机上就没有问题iOS 12.2 版别一下的都有问题。

iOS 16 适配问题记录

查找后发现,开发者社区中有此问题的记载,xcode14:Library not loaded: /usr/lib/swift/libswiftCoreGraphics.dylib,解决计划是:

If you are building your app with Xcode 14 or Xcode 14.0.1, your app will crash on older OS versions, including while building and testing directly from Xcode, as well as after submitting the app to the App Store. The OS versions affected include iOS 11 - 12.1, macOS 10.13 - 10.14.3, as well as watchOS and tvOS versions from the same time frame. To work around the crash when building with Xcode 14, **add -Wl,-weak-lswiftCoreGraphics (substituting other library names for swiftCoreGraphics if appropriate for your crash) to the Other Linker Flags build setting**.

但是需求注意的是,假如项目有多个Target,如果增加在Target中,就要针对每个Target都要增加一次,很是费事,所以能够直接在PROJECT下的Build Settings中增加。

在项目中增加了-Wl,-weak-lswiftCoreGraphicsOther Linker Flags之后

假如说增加完之后仍是会有报错

iOS 16 适配问题记录

细心看了之后,发现报错中提示的FSPagerView,是CocoaPods三方库,所以找到对应的第三方库,然后在对应库的Build Settings中找到Other Linker Flags,然后增加-Wl,-weak-lswiftCoreGraphics,再运转,发现仍是报错,但是换了另一个三方库。

所以有没有可能,在Podfilepost_install增加设置,一致一次性给所有三方库加这个编译设置。当然能够,设置如下:

post_install do |installer|
     installer.pods_project.targets.each do |target|  
       target.build_configurations.each do |config| 
       config.build_settings['OTHER_LDFLAGS'] = '-Wl,-weak-lswiftCoreGraphics' 
     end 
   end 
 end

然后编译,发现报错,因为项目中有些库没有用到swiftCoreGraphics,比如OC的三方库,或者非UI的库,所以仍是要改,需求区别增加。针对项目中Swift类型的UI相关的库,增加这个编译选项,其他的不增加,最终示例如下:

need_otherlinkerflags_frameworks = ['FSPagerView', 'HandyJSON', 'IQKeyboardManagerSwift', 'JXSegmentedView', 'KDCircularProgress', 'Kingfisher', 'RxSwift', 'PKHUD', 'RxCocoa', 'SnapKit', 'ZLPhotoBrowser']
post_install do |installer| 
  installer.pods_project.targets.each do |target| 
    target.build_configurations.each do |config| 
      if need_otherlinkerflags_frameworks.include?(target.name) 
      config.build_settings['OTHER_LDFLAGS'] = '-Wl,-weak-lswiftCoreGraphics' 
   end    
  end 
 end 
end

Pod install后,编译运转,发现能够正常运转了。再验证一下,非低版别手机上是否受到影响,没有影响,完美。

如果说还有问题,那么target 里面Build Phases -> Link Binary With Librarires 里面增加libswiftCoreGraphics.tbd 就能够解决问题

3.视频反正屏切换

[UIDevice currentDevice] 使用setValue:forKey:的方式在iOS16上面现已不可用,继而要使用 我遇到一个古怪的现象便是,自己晋级到16.0.3 版别后忽然视频的横屏放大不能用了,然后就做了iOS 16 判别用了新的方法就好了。但删除APP 去从头下载旧的APP。屏幕放大转旋仍然好用。

UIWindowScene *windowScene = (UIWindowScene *)[[[UIApplication sharedApplication] connectedScenes] allObjects].firstObject;
UIWindowSceneGeometryPreferencesIOS *perference = [[UIWindowSceneGeometryPreferencesIOS alloc] init];
perference.interfaceOrientations = 1 << deviceOrientation;
[windowScene requestGeometryUpdateWithPreferences:perference errorHandler:^(NSError * _Nonnull error) {
NSLog(@"error--%@", error);
}];
} else {
[[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:deviceOrientation] forKey:@"orientation"];
[UIViewController attemptRotationToDeviceOrientation];
}

4.iOS normal arm64 com.apple.xcode.tools.swift.compiler is not absolute.

iOS normal arm64 com.apple.xcode.tools.swift.compiler is not absolute.

或者是

Showing All Errors Only Command SwiftDriver Compilation Requirements emitted errors but did not return a nonzero exit code to indicate failure

报错显示上面的问题,删掉了User Header Search Paths中的内容,清理了缓存。

5.# iOS 16.0 导航栏titleView的title 偏下问题适配

iOS 16 适配问题记录

依据层级显示,在iOS 16.0 中 新增了一个私有类_UINavigationBarTitleControl,它将咱们供给的自定义titleView进行了包裹。导致使用体系的导航栏,标题偏下。

UI展现异常的titleView其父层级的_UINavigationBarTitleControl有束缚异常的提示,说明_UINavigationBarTitleControl是通过子视图获取尺度进行的束缚。

但其内部的视图关系在展现出来之前是不确定的,也便是自定义视图titleView.superView在完全展现前并不一定会存在。所以,自定义视图中不要随意重写 -updateConstraints, 并保证其autolayout条件正确,解决了咱们问题

网上暂时找的处理计划 既然是体系autolayout的异常,那咱们就声明一下咱们希望的尺度。 在自定义titleView的实现中重写intrinsicContentSize方法,它会向体系声明咱们希望的尺度

- (CGSize)intrinsicContentSize {
    return UILayoutFittingExpandedSize; // 表示在可用范围内尽可能给予最大可用尺度
}

后续有发现新的问题再更新。