[Bug]: Cordova iOS UIView Extension causes incompatibilities
Capacitor Version
Capacitor 7.2.0 XCode 16.3 Swift 5
Other API Details
Platforms Affected
- [x] iOS
- [ ] Android
- [ ] Web
Current Behavior
// CDVPlugin @interface UIView (org_apache_cordova_UIView_Extension)
@property (nonatomic, weak) UIScrollView* scrollView;
@end
When I used in Swift, Compile error with "Found this candidate in module 'Cordova'", the name 'scrollView' in extension is so sample, please use another name, which may be using a prefix, just like cdvScrollView.
Expected Behavior
please use another name, which may be using a prefix, just like cdvScrollView
Project Reproduction
none
Additional Information
No response
Can you add a bit more detail as to why it is you need this and a reproduction? And add a title?
This issue needs more information before it can be addressed. In particular, the reporter needs to provide a minimal sample app that demonstrates the issue. If no sample app is provided within 15 days, the issue will be closed. Please see the Contributing Guide for how to create a Sample App. Thanks! Ionitron 💙
@markemer I want to use this pod https://github.com/pujiaxin33/JXPagingView. open class JXPagingListContainerView: UIView { public private(set) var type: JXPagingListContainerType public private(set) weak var dataSource: JXPagingListContainerViewDataSource? public private(set) var scrollView: UIScrollView! ....... }
If any other swift view has a property 'scrollView' , it will compile fail, "Found this candidate in module 'Cordova'", the name 'scrollView'"
CDVPlugin is from Cordova, we include it for Cordova Compatibility, so we can't change this. Feel free to change it for yourself locally, or talk to the Cordova team.
We don't use cordova-ios, but our own modified version.
Cordova has handled this already here for cordova-ios 8.
This is something we might want to address in @capacitor/ios 8, following the same approach, or removing it entirely as it's planned for cordova-ios 9, but having in mind that will break some plugins.
Or maybe make the UIView a WKWebView as it already has an UIScrollView, but that could probably lead to other issues.
This issue has been labeled as type: bug. This label is added to issues that that have been reproduced and are being tracked in our internal issue tracker.
We don't use cordova-ios, but our own modified version. Cordova has handled this already here for cordova-ios 8. This is something we might want to address in
@capacitor/ios8, following the same approach, or removing it entirely as it's planned forcordova-ios9, but having in mind that will break some plugins. Or maybe make theUIViewaWKWebViewas it already has anUIScrollView, but that could probably lead to other issues.
Yeah, I like that WKWebView idea a lot, but I'd be worried about drifting that far from Cordova in a compatibility layer, but seeing as they plan to remove it entirely in cordova-ios 9, maybe we should jump the gun and just do it. Or follow the same path if we're worried about breakage.