简体   繁体   English

弹出 storyboard 并移回上一个视图控制器(笔尖)

[英]Popping out storyboard and moving back to previous viewcontroller (nib)

I have one storyboard project which I want to integrate in one existing project having nibs and viewcontroller.我有一个 storyboard 项目,我想将其集成到一个现有的具有 nib 和视图控制器的项目中。

I have pushed storyboard from one of the viewcontroller using:我已使用以下视图控制器之一推送 storyboard:

let viewController:UIViewController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()!
    viewController.modalPresentationStyle = .fullScreen
    self.present(viewController, animated: false, completion: nil)

How can I move back from the story board to previous view controller, I have added back button and on press of back button I am executing below code but it is not popping out.我如何从故事板返回到前一个视图 controller,我添加了后退按钮,按下后退按钮我正在执行下面的代码,但它没有弹出。

 @IBAction func goBack(sender: UIButton) {
    self.navigationController?.popViewController(animated: true)
}

Use dismiss(animated:) method.使用dismiss(animated:)方法。

@IBAction func goBack(sender: UIButton) {
    dismiss(animated: true)
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM