fix: iOS 26 APIs compatibility with Mac Catalyst build
2 files changed,
+7
−0
ios/LChat/Views/ChatView.swift+5 −0ios/LChat/Views/EdgeOnlyBackGesture.swift+2 −0
diff --git a/ios/LChat/Views/ChatView.swift b/ios/LChat/Views/ChatView.swift| index 34af9b3..6948252 100644 |
| --- a/ios/LChat/Views/ChatView.swift |
| +++ b/ios/LChat/Views/ChatView.swift |
| @@ -537,12 +537,17 @@ struct ChatFeedWebView: UIViewRepresentable { |
| // element falls back the same way. |
| extension View { |
| @ViewBuilder func floatingGlass<S: InsettableShape>(in shape: S) -> some View { |
| + #if os(iOS) |
| if #available(iOS 26.0, *) { |
| self.glassEffect(.regular, in: shape) |
| } else { |
| self.background(.ultraThinMaterial, in: shape) |
| .overlay(shape.strokeBorder(Color(.separator).opacity(0.4), lineWidth: 0.5)) |
| } |
| + #else |
| + self.background(.ultraThinMaterial, in: shape) |
| + .overlay(shape.strokeBorder(Color(.separator).opacity(0.4), lineWidth: 0.5)) |
| + #endif |
| } |
| } |
diff --git a/ios/LChat/Views/EdgeOnlyBackGesture.swift b/ios/LChat/Views/EdgeOnlyBackGesture.swift| index f6364c5..7cbba19 100644 |
| --- a/ios/LChat/Views/EdgeOnlyBackGesture.swift |
| +++ b/ios/LChat/Views/EdgeOnlyBackGesture.swift |
| @@ -19,9 +19,11 @@ struct EdgeOnlyBackGesture: UIViewRepresentable { |
| override func didMoveToWindow() { |
| super.didMoveToWindow() |
| guard window != nil, let nav = navigationController() else { return } |
| + #if os(iOS) |
| if #available(iOS 26.0, *) { |
| nav.interactiveContentPopGestureRecognizer?.isEnabled = false |
| } |
| + #endif |
| } |
| private func navigationController() -> UINavigationController? { |