Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

fix(mobile): iOS 27 SDK 编译时按系统忽略兼容模式判定 Liquid Glass

DavidShen38a997817aed
diff --git a/apps/mobile/modules/xdt-ios-action-sheet/ios/XdtIosActionSheetModule.swift b/apps/mobile/modules/xdt-ios-action-sheet/ios/XdtIosActionSheetModule.swift
index bf5e8dcb53..3b03520c87 100644
--- a/apps/mobile/modules/xdt-ios-action-sheet/ios/XdtIosActionSheetModule.swift
+++ b/apps/mobile/modules/xdt-ios-action-sheet/ios/XdtIosActionSheetModule.swift
@@ -135,17 +135,30 @@ private final class CindyBottomActionSheetController: UIViewController, UITableV
private let tableView = UITableView(frame: .zero, style: .insetGrouped)
private var picked = false
- /// 与 CindyComposerMorphModule / expo-glass-effect 同口径:只有 iOS 26 SDK 编译、
- /// iOS 26+ 运行且未声明兼容模式时,系统 Sheet 才带 Liquid Glass 材质。
+ /// 与 expo-glass-effect(SDK 57 上游)的 isLiquidGlassAvailable 同口径:只有 iOS 26 SDK
+ /// 编译、iOS 26+ 运行且未声明兼容模式时,系统 Sheet 才带 Liquid Glass 材质。
private static let liquidGlassAvailable: Bool = {
#if compiler(>=6.2)
if #available(iOS 26.0, *) {
+ // iOS 27 SDK 编译的 App 在 iOS 27+ 上,系统忽略 UIDesignRequiresCompatibility。
+ if #available(iOS 27.0, *), buildSDKMajorVersion() >= 27 {
+ return true
+ }
return (Bundle.main.infoDictionary?["UIDesignRequiresCompatibility"] as? Bool) != true
}
#endif
return false
}()
+ /// 编译时 SDK 的主版本,取自 Xcode 写入的 DTPlatformVersion;缺失时视为旧 SDK。
+ private static func buildSDKMajorVersion() -> Int {
+ guard let platformVersion = Bundle.main.infoDictionary?["DTPlatformVersion"] as? String,
+ let major = Int(platformVersion.prefix { $0.isNumber }) else {
+ return 0
+ }
+ return major
+ }
+
private var actionIndices: [Int] {
labels.indices.filter { $0 != cancelButtonIndex }
}