ios - Perform a parent segue from the embedded view controller -


i have this:

  • mytableviewcontroller (inherits uitableviewcontroller)

    • it has dynamic tableview few cells (foo, bar, qux)

  • myviewcontroller (inherits uiviewcontroller)

    • there "show" segues controller other view controllers
    • it has uicontainerview embeds mytableviewcontroller

a picture speaks thousand words:

embedded uitableviewcontroller

when cell selected, want perform segue of 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 possible? should use in «what»?

in prepareforsegue: embedded segue set viewcontroller in new property in tableviewcontroller, let's name parentcontroller. , you'll have call self.parentcontroller.performseguewithidentifier().

edit: first of all, maybe can use existing parentviewcontroller if contains embedding view controller.


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -