I have this:
MyTableViewController
(inherits from UITableViewController
)
MyViewController
(inherits from UIViewController
)
A picture speaks a thousand words:
When a certain cell is selected, I want to perform a segue of the parent view (MyViewController
)
override func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
if (indexPath.section == 1 && indexPath.row == 1) {
self.WHAT.performSegueWithIdentifier("someShowSegue1", sender: self)
}
}
Is it possible? what should I use in «WHAT»
?
In the prepareForSegue:
for your embedded segue set the viewController
in a new property in your tableViewController
, let's name it parentController
. And then you'll have just to call self.parentController.performSegueWithIdentifier()
.
EDIT: But first of all, maybe you can use the existing parentViewController
if it contains the embedding view controller.