使用按钮(快速键)显示位于标签栏控制器内的视图控制器

时间:2018-07-15 00:32:25

标签: swift xcode uiviewcontroller uitabbarcontroller viewcontroller

我在xib文件中有一个按钮,该按钮应该显示保存在我的标签栏控制器(位于Main.storyboard中)中的视图控制器之一。使用下面的代码,我已经能够创建我要显示的视图的副本,但是它的底部没有工具栏。有没有一种方法可以通过单击按钮来导航到我在故事板中看到的由选项卡栏控制器保存的视图?

@IBAction func submit(_ sender: UIButton) {

  let storyboard = UIStoryboard(name: "Main", bundle: nil)
  let secondVC = storyboard.instantiateViewController(withIdentifier: "statisticsID") as! statistics
  self.present(secondVC, animated: true, completion: nil)

}

0 个答案:

没有答案