I have an InvoiceVC in the second tab bar ( tab Bar index : 1 ) like the picture above. if the table view cell is tapped, I need to segue to the InvoiceDetailVC like the picture below
as you can see in the InvoiceDetailVC, there is no tab bar in the bottom of the InvoiceDetailVC, I mean that tab that has red badge in the bottom. I need remove that tab bar.
I have tried to use present modally instead of push show segue. But the problem is, there is no back button to back to InvoiceVC
so what should I do ?
Use in prepareforsegue
while pushing and set hidesBottomBarWhenPushed
to true to hide the tabbar on destination view controller.
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if (segue.identifier == "InvoiceVC") {
let indexPath: IndexPath? = tableView.indexPathForSelectedRow
let destViewController = segue.destination as? InvoiceVC
destViewController?.recipeName = recipes[indexPath?.row ?? 0]
destViewController?.hidesBottomBarWhenPushed = true
}
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.