# Uncomment the next line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'

platform :ios, '13.0'
install! 'cocoapods', :disable_input_output_paths => true

target 'HealthEmergency' do
  use_frameworks! :linkage => :static
  use_modular_headers!
  
  pod 'Alamofire'
  pod 'Moya'
  pod 'Toast-Swift'
  pod 'MJRefresh'#下拉刷新
  pod 'SnapKit'#自动布局
  pod 'Kingfisher'
  pod 'JXSegmentedView'#分页框架
  pod 'SwiftTheme'
  pod 'SwiftEntryKit', '2.0.0'
  pod 'lottie-ios'
  pod 'IQKeyboardManagerSwift'
  pod 'DGCharts'
  pod 'SkeletonView'#用户等待动画
  pod 'JTAppleCalendar'
  #高德
  pod 'AMap3DMap' #3D地图SDK
  pod 'AMapSearch' #搜索功能 end
  pod 'AMapLocation' #定位SDK
  #集成聊天
  # 集成基础库（必选）
  pod 'TUICore', :path => "TUIKit/TUICore"
  pod 'TIMCommon_Swift', :path => "TUIKit/TIMCommon"
  # 集成TUIKit组件（可选）
  # 集成聊天功能
  pod 'TUIChat_Swift', :path => "TUIKit/TUIChat"
  # 集成会话功能
  pod 'TUIConversation_Swift', :path => "TUIKit/TUIConversation"
  # 集成关系链功能
  pod 'TUIContact_Swift', :path => "TUIKit/TUIContact"
  # 集成搜索功能（需要购买旗舰版或企业版套餐）
  pod 'TUISearch_Swift', :path => "TUIKit/TUISearch"
  
  # 集成音视频通话功能
  pod 'TUICallKit_Swift'
  
  # 集成 TUIKitPlugin 插件 （可选）
  # 集成翻译插件（需单独购买插件）
  pod 'TUITranslationPlugin_Swift'
  # 集成语音转文字插件（需单独购买插件）
  pod 'TUIVoiceToTextPlugin_Swift'
end
   #Pods config
   post_install do |installer|
       installer.pods_project.targets.each do |target|
           target.build_configurations.each do |config|
               #Fix Xcode14 Bundle target error
               config.build_settings['EXPANDED_CODE_SIGN_IDENTITY'] = ""
               config.build_settings['CODE_SIGNING_REQUIRED'] = "NO"
               config.build_settings['CODE_SIGNING_ALLOWED'] = "NO"
               config.build_settings['ENABLE_BITCODE'] = "NO"
               config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = "13.0"
               #Fix Xcode15 other links  flag  -ld64
               xcode_version = `xcrun xcodebuild -version | grep Xcode | cut -d' ' -f2`.to_f
               if xcode_version >= 15
                 xcconfig_path = config.base_configuration_reference.real_path
                 xcconfig = File.read(xcconfig_path)
                 if xcconfig.include?("OTHER_LDFLAGS") == false
                   xcconfig = xcconfig + "\n" + 'OTHER_LDFLAGS = $(inherited) "-ld64"'
                 else
                   if xcconfig.include?("OTHER_LDFLAGS = $(inherited)") == false
                     xcconfig = xcconfig.sub("OTHER_LDFLAGS", "OTHER_LDFLAGS = $(inherited)")
                   end
                   if xcconfig.include?("-ld64") == false
                     xcconfig = xcconfig.sub("OTHER_LDFLAGS = $(inherited)", 'OTHER_LDFLAGS = $(inherited) "-ld64"')
                   end
                 end
                 File.open(xcconfig_path, "w") { |file| file << xcconfig }
               end
           end
       end
   end
