|
@@ -2,6 +2,10 @@ use_frameworks!
|
|
|
|
|
|
platform :ios, '10.0'
|
|
|
|
|
|
+pre_install do |installer|
|
|
|
+ remove_swiftui()
|
|
|
+end
|
|
|
+
|
|
|
target 'BFCommonKit_Example' do
|
|
|
pod 'BFCommonKit', :path => '../'
|
|
|
|
|
@@ -9,3 +13,15 @@ target 'BFCommonKit_Example' do
|
|
|
inherit! :search_paths
|
|
|
end
|
|
|
end
|
|
|
+
|
|
|
+def remove_swiftui
|
|
|
+ # 解决 xcode13 Release模式下SwiftUI报错问题
|
|
|
+ system("rm -rf ./Pods/Kingfisher/Sources/SwiftUI")
|
|
|
+ code_file = "./Pods/Kingfisher/Sources/General/KFOptionsSetter.swift"
|
|
|
+ code_text = File.read(code_file)
|
|
|
+ code_text.gsub!(/#if canImport\(SwiftUI\) \&\& canImport\(Combine\)(.|\n)+#endif/,'')
|
|
|
+ system("rm -rf " + code_file)
|
|
|
+ aFile = File.new(code_file, 'w+')
|
|
|
+ aFile.syswrite(code_text)
|
|
|
+ aFile.close()
|
|
|
+end
|