dpogue commented on code in PR #1699:
URL: https://github.com/apache/cordova-ios/pull/1699#discussion_r3861115835
##########
CordovaLib/Classes/Public/CDVViewController.m:
##########
@@ -578,6 +578,11 @@ - (void)onWebViewPageDidLoad:(NSNotification*)notification
}
}
+/**
+ * This is called initially when the WKWebView is initialized and also when
viewport-fit is changed.
+ * WebKit still doesn't expose
_webView:didChangeSafeAreaShouldAffectObscuredInsets: as public API,
+ * so we need to react based on the scrollView delegate.
+ */
- (void)scrollViewDidChangeAdjustedContentInset:(UIScrollView *)scrollView
Review Comment:
This is a standard UIScrollViewDelegate method:
https://developer.apple.com/documentation/uikit/uiscrollviewdelegate/scrollviewdidchangeadjustedcontentinset(_:)?language=objc
So it's probably best not to make reference to WebKit internals here.
Something like "We use this delegate method on the web view's scrollView to
detect when the safe area insets are changed by the viewport-fit value" would
probably be better.
The problem with putting lots of specific details in comments is that they
can quickly get outdated and then nobody knows if they're still relevant of
not. I've found that sort of thing in several places in Cordova with comments
dating back to Cordova 3, and I still can't make sense of some of them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]