SWRevealViewController open tableview when cell selected - Swift -
i using swrevealviewcontroller, have 3 cells "first" "second" "last". , have 3 different tableviews, "firsttableviewcontroller", "secondtableviewcontroller", "lasttableviewcontroller".
i tried use didselectrowatindexpath, prepareforsegue. couldn't implement multipe segues in didselectrowatindexpath.
is there way this?
import uikit class sidebartableviewcontroller: uitableviewcontroller { var menuarray = [string]() override func viewdidload() { super.viewdidload() menuarray = ["first","second","last"] var view = uiview(frame: cgrectzero) self.tableview.tablefooterview = view self.tableview.backgroundcolor = uicolor.whitecolor() } override func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { return menuarray.count } override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { var cell = tableview.dequeuereusablecellwithidentifier(menuarray[indexpath.row], forindexpath: indexpath) uitableviewcell cell.textlabel?.text = menuarray[indexpath.row] return cell } }
cell identifiers : first, second, last
thanks,
ok, found solution. followed tutorial, there no need set segue in code, kntrl+drag view controllers , select "swrevealviewcontrollerseguepushcontroller" ...
Comments
Post a Comment