Yes, you can do it fast. Just load tableViewController as usual. You just need to call
In swift
let rowToSelect:NSIndexPath = NSIndexPath(forRow: 0, inSection: 0); //slecting 0th row with 0th section self.tableView.selectRowAtIndexPath(rowToSelect, animated: true, scrollPosition: UITableViewScrollPosition.None);
The selectRowAtIndexPath function selectRowAtIndexPath not run the delegate methods, such as didSelectRowAtIndexPath: so you need to manually run this delegate method
self.tableView(self.tableView, didSelectRowAtIndexPath: rowToSelect);
Or If you click ViewControllers using segue, you need to call performSegueWithIdentifier
self.performSegueWithIdentifier("yourSegueIdentifier", sender: self);
Now you can click viewController in didSelectRowAtIndexpath . To select the first row in the first section or to execute the whaterver that you wrote in didSelectRowAtIndexPath: from tableView
As for your case, just click viewController to select in the 0th index using didSelectRowAtIndexpath
func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!){ if indexPath.row == 0 { self.navigationController.pushViewController(yourViewControllerToPush, animated: YES); }
It will show that the view controller is pressed, and if you do not want the animation view controller to just go through the NO method to pushViewController .
When you click the Back button, you will return to your viewController
In your case, just write this in your viewDidAppear
if firstStart { firstStart = false let rowToSelect:NSIndexPath = NSIndexPath(forRow: 0, inSection: 0) self.tableView.selectRowAtIndexPath(rowToSelect, animated: true, scrollPosition:UITableViewScrollPosition.None) self.performSegueWithIdentifier("showForecastSelectedCity", sender: self) }