1

have 12 category list (rows) in a tableview1..for each category you select i want to display subcategory in another viewcontroller's tableview..how do i make my viewcontroller2's tableview return different number of rows and different cell values based on which row you select in tablevew1 of viewcontroller1...

func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
    if indexPath.section == 1 {
        performSegueWithIdentifier("show", sender: self)
    }
    if indexPath.section == 2 && indexPath.row == 1 {
        self.tabBarController?.selectedIndex = 2
    }
    if indexPath.section == 2 && indexPath.row == 2 {
        self.tabBarController?.selectedIndex = 3
    }
    if indexPath.section == 2 && indexPath.row == 3 {
        self.tabBarController?.selectedIndex = 1
    }

i can identify which row is tapped and perform seguewithidentifier to another viewcontroller2 but how do i get different values from viewcontroler 2's tableview(subcategory) for each row tapped in viewcontroller1's tableview

pnuts
  • 58,317
  • 11
  • 87
  • 139
Ninja13
  • 883
  • 1
  • 6
  • 9

0 Answers0