apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.15k stars 986 forks source link

CDVPlugin's viewController should just be a CDVViewController #1428

Open dpogue opened 2 weeks ago

dpogue commented 2 weeks ago

Feature Request

Motivation Behind Feature

CDVPlugin has a viewController property that is currently typed as UIViewController*. However, it is only ever set from within CDVViewController and is always set to a CDVViewController* instance.

Feature Description

We should just update the CDVPlugin API so that viewController is typed as CDVViewController* rather than UIViewController*.

Since CDVViewController is a subclass of UIViewController this shouldn't break any plugins, but it is an API change and should be handled in the next major.

Alternatives or Workarounds

Currently the standard practice is to just cast (CDVViewController*)self.viewController everywhere, which works fine but is kinda annoying.