Skip to content

Commit

Permalink
fix!: Deprecate scrollView category extension on UIView (#1400)
Browse files Browse the repository at this point in the history
This **removes** the API from Swift to solve the immediate problem in #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 GH-1399.
  • Loading branch information
dpogue authored Aug 24, 2024
1 parent 27a6068 commit 39fbf29
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions CordovaLib/include/Cordova/CDVPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@
#import <Cordova/CDVWebViewEngineProtocol.h>
#import <Cordova/CDVInvokedUrlCommand.h>

#ifndef __swift__
// This global extension to the UIView class causes issues for Swift subclasses
// of UIView with their own scrollView properties, so we're removing it from
// the exposed Swift API and marking it as deprecated
// TODO: Remove in Cordova 9
@interface UIView (org_apache_cordova_UIView_Extension)

@property (nonatomic, weak) UIScrollView* scrollView;

@property (nonatomic, weak) UIScrollView* scrollView CDV_DEPRECATED(8, "Check for a scrollView property on the view object at runtime and invoke it dynamically.");
@end
#endif

extern const NSNotificationName CDVPageDidLoadNotification;
extern const NSNotificationName CDVPluginHandleOpenURLNotification;
Expand Down

0 comments on commit 39fbf29

Please sign in to comment.