Fix TabBar icon assets and simplify Podfile post_install.

Rename tab icons to snake_case with @2x/@3x scales, register CYL plus button at app launch, and remove redundant Podfile hooks already covered by the Xcode project.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-26 18:49:37 +08:00
parent a1c031c9b7
commit 43179abf2c
52 changed files with 93 additions and 82 deletions

56
Podfile
View File

@ -7,7 +7,7 @@ target 'suixinkan_ios' do
pod 'Kingfisher', '~> 8.0'
pod 'CYLTabBarController', '~> 1.99.38'
# 高德地图 SDK:仅真机构建时链接;模拟器通过 post_install 剥离
# 高德地图 SDK 仅支持真机;模拟器通过下方 post_install 剥离链接
pod 'AMap3DMap-NO-IDFA', '~> 11.1'
pod 'AMapSearch-NO-IDFA', '~> 9.7'
pod 'AMapLocation-NO-IDFA', '~> 2.11'
@ -17,6 +17,7 @@ target 'suixinkan_ios' do
end
end
# 模拟器构建时不链接高德(真机专用 framework仅保留通用 Pod 依赖
SIMULATOR_OTHER_LDFLAGS = <<~FLAGS.squish
-ObjC -l"c++" -l"swiftCoreGraphics" -l"z"
-framework "Accelerate" -framework "CFNetwork" -framework "CYLTabBarController"
@ -32,6 +33,12 @@ post_install do |installer|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '16.0'
end
next unless target.name.start_with?('AMap')
target.build_configurations.each do |config|
config.build_settings['SUPPORTED_PLATFORMS'] = 'iphoneos'
end
end
%w[Pods-suixinkan_ios Pods-suixinkan_iosTests].each do |target_name|
@ -48,51 +55,4 @@ post_install do |installer|
File.write(path, content)
end
end
installer.pods_project.targets.each do |target|
next unless target.name.start_with?('AMap')
target.build_configurations.each do |config|
config.build_settings['SUPPORTED_PLATFORMS'] = 'iphoneos'
end
end
resources_script = File.join(
installer.sandbox.root,
'Target Support Files/Pods-suixinkan_ios/Pods-suixinkan_ios-resources.sh'
)
if File.exist?(resources_script)
content = File.read(resources_script)
unless content.include?('SKIP_AMAP_RESOURCES_FOR_SIMULATOR')
content.sub!(
"RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt",
<<~SHELL
# SKIP_AMAP_RESOURCES_FOR_SIMULATOR
if [ "${EFFECTIVE_PLATFORM_NAME}" = "-iphonesimulator" ]; then
exit 0
fi
RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt
SHELL
)
File.write(resources_script, content)
end
end
installer.aggregate_targets.each do |aggregate_target|
aggregate_target.user_project.native_targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = ''
config.build_settings['ENABLE_USER_SCRIPT_SANDBOXING'] = 'NO'
next unless target.name == 'suixinkan_ios'
existing = config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS[sdk=iphoneos*]'] || '$(inherited)'
unless existing.to_s.include?('AMAP_ENABLED')
config.build_settings['SWIFT_ACTIVE_COMPILATION_CONDITIONS[sdk=iphoneos*]'] = "#{existing} AMAP_ENABLED"
end
end
end
aggregate_target.user_project.save
end
end