[英]Change View Controller in Tab Bar Controller (Swift)
A little background: My app pops a View Controller that has questions. 一点背景:我的应用程序弹出一个有问题的View Controller。 When the person has answered the question, they swipe and View Controller is presented again, this time with new questions (so it is View Controller with question set 1 -> swipe -> (same) View Controller with question set 2). 当此人回答了问题后,他们将滑动并再次显示View Controller,这次是新问题(因此问题集为1的View Controller->滑动->问题集2的(相同)View Controller)。
This works fine when I do not have View Controller embedded in a Tab Bar Controller. 当我没有在选项卡栏控制器中嵌入视图控制器时,这可以很好地工作。 However, when it is embedded in a Tab Bar Controller and I swipe, the View Controller is presented but the Tab Bar Controller is no longer there. 但是,当将其嵌入到Tab Bar Controller中并且我滑动时,将显示View Controller,但Tab Bar Controller不再存在。
I want the tab bar to remain at the bottom of the screen but I want the View Controller to change upon swiping 我希望标签栏保留在屏幕底部,但我希望View Controller在滑动时进行更改
func swipeGesture() {
// gesture stuff in here
self.present(ViewController(), animated: true)
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.