UITabBarController
具有属性selectedIndex
,您可以使用该属性切换所选的选项卡。因此,在关闭UploadViewController之后,您可以运行:当前在我的viewController:Upload上,仅当所有信息都填写完毕后,我的按钮才会将数据发送到我的数据库,然后使用以下命令返回到预览视图(表View):self.navigationController?.popViewControllerAnimated(true)
如果可能,我想回到我对tabBarController的主要观点。我尝试了很多操作,例如直接在情节提要中使用将模式自动选择到“ TabBar控制器”,但是我回到TabBar时没有将我的数据发送到数据库,也没有检查信息是否已填写。 >
我该怎么办?
谢谢!
当前在我的viewController上:上传,仅当所有信息都填写好后,我的按钮才将数据发送到我的数据库,然后我使用:self ....返回到预览视图(表View)。] >>> < [
UITabBarController
具有属性selectedIndex
,您可以使用该属性切换所选的选项卡。因此,在关闭UploadViewController之后,您可以运行:self.tabBarController?.selectedIndex = 0 // Index to select
可能最好为您的UploadViewController创建一个委托,以在API调用完成时触发一个函数来完成PreviewVC中的所有工作。
let ID_TABBAR = "TabBarViewCOntroller"
@IBAction func cancelMeme(_ sender: Any) {
let tabBarController = self.storyboard?.instantiateViewController(identifier:ID_TABBAR) as! UITabBarController
self.navigationController?.pushViewController(tabBarController, animated:true)
}
参考one of the responses from this post。
UITabBarController
具有属性selectedIndex
,您可以使用该属性切换所选的选项卡。因此,在关闭UploadViewController之后,您可以运行: