[英]How to call an AppDelegate method from a UIViewController
在我的appDelegate.m文件中,我有这个方法
- (void) goToRN {
[RCTKeyWindow().rootViewController dismissViewControllerAnimated:true completion:nil];
}
我想从我的ConsentViewController.swift文件中调用此方法,例如: AppDelegate().goToRN()
但我收到此错误: Value of type 'AppDelegate' has no member 'goToRN'
您可以从应用程序全局变量中获取它:
NSApp.delegate
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.