dpogue commented on code in PR #1565:
URL: https://github.com/apache/cordova-ios/pull/1565#discussion_r2410973520
##########
CordovaLib/CordovaLib.docc/upgrading-8.md:
##########
@@ -125,18 +125,17 @@ You can still access the `scrollView` property of the web
view by dynamically in
```objc
// Old code
-UIScrollView *scroller = self.webView.scrollView;
+UIScrollView *scrollView = self.webView.scrollView;
```
```objc
// New code (Objective-C)
#import <objc/message.h>
-UIScrollView *scroller;
-SEL scrollViewSelector = NSSelectorFromString(@"scrollView");
+UIScrollView *scrollView;
-if ([self.webView respondsToSelector:scrollViewSelector]) {
- scroller = ((id (*)(id, SEL))objc_msgSend)(self.webView,
scrollViewSelector);
+if ([self.webView respondsToSelector:@selector(scrollView)]) {
+ UIScrollView *scrollView = [self.webView
performSelector:@selector(scrollView)];
Review Comment:
Right now this would be redeclaring `scrollView` rather than assigning it.
```suggestion
scrollView = [self.webView performSelector:@selector(scrollView)];
```
--
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]