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'
2.xcode14打出来的包多了一些系统库在iOS 12.2 一下的版本直接奔溃
xcode 14 导出的新包后,打开就崩溃,但是在系统版本高的手机上就没有问题iOS 12.2 版本一下的都有问题。
搜索后发现,开发者社区中有此问题的记录,xcode14:Library not loaded: /usr/lib/swift/libswiftCoreGraphics.dylib,解决方案是:
If you are building your app with Xcode 14or 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-lswiftCoreGraphics到Other Linker Flags之后
假如说添加完之后还是会有报错
仔细看了之后,发现报错中提示的FSPagerView,是CocoaPods三方库,所以找到对应的第三方库,然后在对应库的Build Settings中找到Other Linker Flags,然后添加-Wl,-weak-lswiftCoreGraphics,再运行,发现还是报错,但是换了另一个三方库。
所以有没有可能,在Podfile中post_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'
然后编译,发现报错,因为项目中有些库没有用到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'
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 codeto indicate failure
报错显示上面的问题,删掉了User Header Search Paths中的内容,清理了缓存。
5.# iOS 16.0 导航栏titleView的title 偏下问题适配
根据层级显示,在iOS 16.0 中 新增了一个私有类 _UINavigationBarTitleControl,它将我们提供的自定义titleView进行了包裹。导致使用系统的导航栏,标题偏下。
UI展示异常的titleView其父层级的_UINavigationBarTitleControl 有约束异常的提示,说明_UINavigationBarTitleControl是通过子视图获取尺寸进行的约束。
但其内部的视图关系在展示出来之前是不确定的,也就是自定义视图titleView.superView在完全展示前并不一定会存在。所以,自定义视图中不要随意重写 -updateConstraints, 并保证其autolayout条件正确,解决了我们问题
网上暂时找的处理方案既然是系统autolayout的异常,那我们就声明一下我们期望的尺寸。 在自定义titleView的实现中重写 intrinsicContentSize 方法,它会向系统声明我们期望的尺寸
- (CGSize)intrinsicContentSize {
returnUILayoutFittingExpandedSize; // 表示在可用范围内尽可能给予最大可用尺寸
后续有发现新的问题再更新。
有任何谷歌苹果上架问题都我都可以帮你解决,灰机:ruirui零二五
现在是2020年3月26号. 因独立开发需要复习 以加深巩固.
我会将我复习 IOSUI开发知识 从基础到进阶 完全的记录下来.
这里会涉及到:从搭建出IOSUI最简单的计算器,到复杂的分布式服务端和微服务的独立开发.
记录下来从前端到后端的全程学习和/复习的过程.
今天是第一篇日记.我会从最简单的计算器日志开始写起.
————————————————————————-
开发环境:Xcode11,ios9或ios13任意版本全兼容适配,2020年3月26
需要深厚的c/objective-c编程经验或c++.毕竟日志是从UI写起来的.
另外,我是自学看黑马的视频进行复习的.有兴
file not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a
关于
Xcode12.4
IOS14正常运行项目
IOS项目启动崩溃
问题解决
launch, loading dependent libraries cocoapods集成三方出现
IOS13启动崩溃
#use_Framework! 然后重新pod install 然后去target里General->Framework里删除原来的pods.framework重新编译
就在前不久,苹果刚刚对外正式发布了新的操作系统IOS10。悲剧的是就在发布新系统的当天公司就急着要发布一个新版本,问题来了。。。谁知道APP在IOS10上会遇到什么鬼情况!最怕的就是闪退。。。于是在上线前做了很多关于IOS10的适配工作,其中也踩了很多坑。所以在这里记录总结一下。
1、自动管理证书
首先要说的就是Xcode8。打开Xcode8最明显的就是Targets–>General下的自动管理证书模块。以前对于新手来说无论是开发还是打包都必须要被苹果的开发签名系统虐上几遍才能真正明白它的原理和规程。现在貌似直接勾上“Automatically manage signing”,Xcode8
在我学习Android开发的时候,觉得设备
适配是件很头疼的事情,android的设备太多了,那时就很羡慕
iOS开发的人不用操心
适配的
问题,而当我开始学习
iOS开发后,
iOS的屏幕也开始多种多样了起来…于是也得做
适配了,sad…
之前也研究过,这里把我的方法
记录下来,本文介绍三个常用的设备信息获取方式:
获取屏幕的宽高。用于在设置控件位置的时候计算相对屏幕的距离
获取设备的型号。5s和6+的屏幕大小相差很远,相应的控件位置、大小都需要做出调整,不然就会出现在6+上显得很空旷或者在5s上显示不全的
问题。
获取系统版本。不同的系统版本有着不同的特性,举个栗子,
iOS 9以下的版本就
升级 iOS 10 之后目测坑还是挺多的,记录一下吧,看看到时候会不会成为一个系列。
直入正题吧
今天在写 Swift 3 相关的一个项目小小练下手,发现调用相机,崩了。试试看调用相册,又特么崩了。然后看到控制台输出了以下信息:
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app’s Info.plist must contain an NSPhotoLibraryUsageDescription key with a