Skip to content

Commit 0f30f0f

Browse files
dpogueOS-kepatotorica
authored andcommitted
fix!: Deprecate scrollView category extension on UIView (apache#1400)
This **removes** the API from Swift to solve the immediate problem in apache#1399 but leaves it available and deprecated in Objective-C due to use in 3rd party plugins. (There are only 2 Swift plugins that use this API as far as I can tell, and neither of them have very high usage or ongoing maintenance.) Closes apacheGH-1399.
1 parent 6ee41c2 commit 0f30f0f

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

CordovaLib/include/Cordova/CDVPlugin.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,15 @@
2828
#import <Cordova/CDVWebViewEngineProtocol.h>
2929
#import <Cordova/CDVInvokedUrlCommand.h>
3030

31+
#ifndef __swift__
32+
// This global extension to the UIView class causes issues for Swift subclasses
33+
// of UIView with their own scrollView properties, so we're removing it from
34+
// the exposed Swift API and marking it as deprecated
35+
// TODO: Remove in Cordova 9
3136
@interface UIView (org_apache_cordova_UIView_Extension)
32-
33-
@property (nonatomic, weak) UIScrollView* scrollView;
34-
37+
@property (nonatomic, weak) UIScrollView* scrollView CDV_DEPRECATED(8, "Check for a scrollView property on the view object at runtime and invoke it dynamically.");
3538
@end
39+
#endif
3640

3741
extern const NSNotificationName CDVPageDidLoadNotification;
3842
extern const NSNotificationName CDVPluginHandleOpenURLNotification;

0 commit comments

Comments
 (0)