Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please remove org_apache_cordova_UIView_Extension because it isn't necessary since iOS 8. #1399

Open
hbordersTwitch opened this issue Feb 20, 2024 · 0 comments · May be fixed by #1400
Open
Milestone

Comments

@hbordersTwitch
Copy link

Feature Request

Cordova contains org_apache_cordova_UIView_Extension in CDVPlugin.h:

@interface UIView (org_apache_cordova_UIView_Extension)

@property (nonatomic, weak) UIScrollView* scrollView;

@end

with an implementation in CDVPlugin.m:

@implementation UIView (org_apache_cordova_UIView_Extension)

@dynamic scrollView;

- (UIScrollView*)scrollView
{
    SEL scrollViewSelector = NSSelectorFromString(@"scrollView");

    if ([self respondsToSelector:scrollViewSelector]) {
        return ((id (*)(id, SEL))objc_msgSend)(self, scrollViewSelector);
    }

    return nil;
}

@end

It appears Cordova only uses the scrollView property on WKWebView instances, and WKWebView has exposed a scrollView property since iOS8, and Cordova's iOS Platform Guide says iOS 11 is the minimum version required for devices to run Cordova. Thus, this extension and artificial property is unnecessary.

Motivation Behind Feature

Apps integrating Cordova with Swift codebases will not compile if Swift classes feature scrollView members in UIView subclasses with visibility less than public. Integrating Cordova would be easier without this extension.

Alternatives or Workarounds

Integrators can manually delete the @interface from the public header file to avoid compilation issues.

@dpogue dpogue added this to the 8.0.0 milestone Feb 20, 2024
dpogue added a commit to dpogue/cordova-ios that referenced this issue Feb 21, 2024
@dpogue dpogue linked a pull request Feb 21, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants