Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
不添加/创建堆栈的Swift Segue_Swift_Segue_Viewcontroller - Fatal编程技术网

不添加/创建堆栈的Swift Segue

不添加/创建堆栈的Swift Segue,swift,segue,viewcontroller,Swift,Segue,Viewcontroller,我想转到我在故事板中创建的视图控制器,而不将其放在堆栈上。我的视图中已经有一个导航栏,所以我不想再添加一个。所以基本上,我选择的这个新视图将是主视图,所以它是堆栈上唯一的视图 按钮动作 @IBAction func addToPlanner(_ sender: Any) { let objSecondVc = self.storyboard?.instantiateViewController(withIdentifier: "AddToPlannerViewContr

我想转到我在故事板中创建的视图控制器,而不将其放在堆栈上。我的视图中已经有一个导航栏,所以我不想再添加一个。所以基本上,我选择的这个新视图将是主视图,所以它是堆栈上唯一的视图

按钮动作

@IBAction func addToPlanner(_ sender: Any) {
        let objSecondVc = self.storyboard?.instantiateViewController(withIdentifier: "AddToPlannerViewController") as? AddToPlannerViewController
        present(objSecondVc!, animated: true, completion: nil)
}

如果您的VC已经有导航控制器,请使用pushViewController

let vc = self.storyboard?.instantiateViewController(withIdentifier: "AddToPlannerViewController") as? AddToPlannerViewController
self.navigationController?.pushViewController(vc!, animated: true)

内部若按钮动作,移除顶部空间区域吗

let objSecondVc = self.storyboard?.instantiateViewController(withIdentifier: "AddToPlannerViewController") as? AddToPlannerViewController
objSecondVc!.modalPresentationStyle = .fullScreen
present(objSecondVc!, animated: true, completion: nil)

我没有导航控制器我在视图控制器中添加了导航栏