如何从Native ViewController返回以在iOS中响应本机页面?

时间:2018-09-17 11:13:54

标签: ios objective-c swift react-native

我有react native页面,通过它我可以重定向Native ViewController,但是单击后退按钮时,我无法从Native ViewController返回到React-Native页面。我已经在后按时添加了日志,并在控制台中获取了日志,但是ViewController并没有被关闭。

    func goToNativeView() { 
self.window = UIWindow(frame: UIScreen.main.bounds) 
let storyboard = UIStoryboard(name: "Main", bundle: nil) 
let initialViewController = storyboard.instantiateViewController(withIdentifier: "ProfilePageInner") 
self.window?.rootViewController = initialViewController self.window?.makeKeyAndVisible()
 }

- (IBAction)BackButton:(id)sender { 
NSLog(@"BACKBUTTONPRESSED"); 
[self dismissViewControllerAnimated:YES completion:nil]; 
} 

0 个答案:

没有答案