Podfile 670 B

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