0

In my appDelegate.m file I have this method

- (void) goToRN {
   [RCTKeyWindow().rootViewController dismissViewControllerAnimated:true completion:nil];
}

and I would like to call this method from my ConsentViewController.swift file like: AppDelegate().goToRN()

but I'm getting this error: Value of type 'AppDelegate' has no member 'goToRN'

nmsdvid
  • 2,832
  • 2
  • 21
  • 21
  • Actually, i answered too fast. This question duplicates this one: https://stackoverflow.com/questions/5082738/ios-calling-app-delegate-method-from-viewcontroller – fewlinesofcode Dec 03 '20 at 11:03

1 Answers1

0

You can get it from the application global variable :

NSApp.delegate
dspr
  • 2,383
  • 2
  • 15
  • 19