fix(ios): actually hide the iOS 26 scroll edge effect
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.
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user