How can I execute segue on another tab in a UITabBarController when the user selects a cell?

I have a UITableViewCell in the first tab of the UITabBarController that contains a list of things. When the user selects a cell, I would like it to go to another tab in the UITabBarController .

I did this using the following code:

 func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) { performSegueWithIdentifier("PerformPlaylistsSegue", sender: self) tableView.deselectRowAtIndexPath(indexPath, animated: true) } 

However, then the problem is that the bottom navigation bar is locked.

I found the following similar problems:

How to switch to the second tab of the tab bar controller from the first tab?

Control Panel Controller / Segue Issue

Both posts mention that it is not recommended to switch to different tabs.

However, based on the purpose of my application, is there a way to make this happen?

0
source share
1 answer

I decided it was better not to mess with the Xcode mother and put my UITableView in the ViewController, where it is assumed that the segued tab will be, and not deal with a headache.

0
source

Source: https://habr.com/ru/post/989495/


All Articles