فهرست منبع

1.打包1.5.0

wenweiwei 3 سال پیش
والد
کامیت
7a7c92f8d2
1فایلهای تغییر یافته به همراه16 افزوده شده و 0 حذف شده
  1. 16 0
      Example/Podfile

+ 16 - 0
Example/Podfile

@@ -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