From 848f55276798cb846fc92545bcb978ce6aa05065 Mon Sep 17 00:00:00 2001 From: Bohdan Triapitsyn Date: Fri, 10 Jul 2026 02:20:41 +0300 Subject: [PATCH] fix(ios): actually hide the iOS 26 scroll edge effect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The compile fix replaced the direct topEdgeEffect API with KVC casting the effect to UIView — but UIScrollEdgeEffect is not a UIView, so the cast silently returned nil and the system's dark edge band stayed visible behind the status bar. Keep the KVC (compiles with pre-26 SDKs) but toggle the ObjC 'hidden' key on the effect as a plain NSObject, guarded by respondsTo. --- packages/mobile/ios/App/App/AppDelegate.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/mobile/ios/App/App/AppDelegate.swift b/packages/mobile/ios/App/App/AppDelegate.swift index 9bcc459e..91ac5b2d 100644 --- a/packages/mobile/ios/App/App/AppDelegate.swift +++ b/packages/mobile/ios/App/App/AppDelegate.swift @@ -146,8 +146,14 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { webView.backgroundColor = .clear webView.scrollView.backgroundColor = .clear if #available(iOS 26.0, *) { + // KVC keeps this compiling with pre-26 SDKs, but the effect object is a + // UIScrollEdgeEffect — NOT a UIView — so it must be handled as a plain + // NSObject ("hidden" is the ObjC key behind isHidden). The previous + // `as? UIView` cast silently returned nil and left the system's dark + // edge band visible behind the status bar. for key in ["topEdgeEffect", "bottomEdgeEffect"] { - (webView.scrollView.value(forKey: key) as? UIView)?.isHidden = true + guard webView.scrollView.responds(to: NSSelectorFromString(key)) else { continue } + (webView.scrollView.value(forKey: key) as? NSObject)?.setValue(true, forKey: "hidden") } } }