presentViewController does not exist

194 Views Asked by At

I am building a plugin in NativeScript. When I try to access "presentViewController" method on rootViewController, I get the error "property presentViewContrller does not exist".

const rvc = UIApplication.sharedApplication.keyWindow.rootViewContrller; rvc.presentViewContrller(myViewController, true, completion() {});

It suggests to use presentViewContrllerAnimatedCompletion which does not accept my view controller.

Could you please assist what part of my code (or maybe setup!) is wrong?

1

There are 1 best solutions below

0
On BEST ANSWER

The right method name is presentViewControllerAnimatedCompletion only.

You should combine the parameter names with method name while marshalling Objective C to JS/TS.

presentViewController:animated:completion