弹出情节提要并返回上一个 viewcontroller (nib)
Popping out storyboard and moving back to previous viewcontroller (nib)
我有一个故事板项目,我想将其集成到一个现有项目中,该项目具有笔尖和 viewcontroller。
我已经从 viewcontroller 之一推送故事板,使用:
let viewController:UIViewController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()!
viewController.modalPresentationStyle = .fullScreen
self.present(viewController, animated: false, completion: nil)
如何从故事板返回到之前的视图控制器,我添加了后退按钮,按下后退按钮我正在执行下面的代码,但它没有弹出。
@IBAction func goBack(sender: UIButton) {
self.navigationController?.popViewController(animated: true)
}
使用dismiss(animated:)
方法。
@IBAction func goBack(sender: UIButton) {
dismiss(animated: true)
}
我有一个故事板项目,我想将其集成到一个现有项目中,该项目具有笔尖和 viewcontroller。
我已经从 viewcontroller 之一推送故事板,使用:
let viewController:UIViewController = UIStoryboard(name: "Main", bundle: nil).instantiateInitialViewController()!
viewController.modalPresentationStyle = .fullScreen
self.present(viewController, animated: false, completion: nil)
如何从故事板返回到之前的视图控制器,我添加了后退按钮,按下后退按钮我正在执行下面的代码,但它没有弹出。
@IBAction func goBack(sender: UIButton) {
self.navigationController?.popViewController(animated: true)
}
使用dismiss(animated:)
方法。
@IBAction func goBack(sender: UIButton) {
dismiss(animated: true)
}