eleven / messenger Public

fix: iOS 26 APIs compatibility with Mac Catalyst build

James Adam 244657bbc7de0595e600ab5d07feb45a8cc9c495 parent f981dbe
2 files changed, +7 −0
  • ios/LChat/Views/ChatView.swift +5 −0
  • ios/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? {