Reputation: 1124
I'd like to show a swift UIViewController
in a flutter app. So far, I successfully :
UIViewController
self.present
this viewNow, inside this plugin, I can instantiate my CustomViewController, but I have no way to show it on screen, because I'm writing a FlutterPlugin
, and it obviously doesn't have any of the facilities like self.window
, self.present
, etc. How can I do that ?
Upvotes: 0
Views: 479
Reputation: 740
You can get the current rootController from the keyWindow and present your custom view controller from there.
UIApplication.shared.keyWindow?.rootViewController?.present(...
Upvotes: 4