1

I use two tableView with 5 and 3 cells over scrollview . Trying to use swipeable gesture on both tableView using editActionsForRowAt method of tableView But it just swipe only three cells of first tableView and other cell swipe by trying 5 to 7 times or unswipeable. Help me to get it , Thanks in advance

my code

func numberOfSections(in tableView: UITableView) -> Int {
    return 1
}

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {

    if tableView == table1{
    return 5
    }
    else if tableView == table2{
    return 3
    }
    else{
    return 0
    }

}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {

    if tableView == table1{

        let cell = meetingTable.dequeueReusableCell(withIdentifier: "myCell") as! meetingCell

        cell.cell_name.text = "abc"
        cell.cell_copny.text = "08276"

        return cell

    }

    else{
        let cell = followTable.dequeueReusableCell(withIdentifier: "myCell") as! FollowUpCell

        cell.cell_name.text = "abc"
        cell.cell_phone.text = "134135"

        return cell

    }

}



func tableView(_ tableView: UITableView, canEditRowAt indexPath: IndexPath) -> Bool {
    return true
}

func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {

}


func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {


    let Btn1 = UITableViewRowAction(style: .normal, title: "\u{1F4DE}\n Btn1") { action, index in
    //code

    }

    Btn1.backgroundColor = UIColor.lightGray

    let Btn2 = UITableViewRowAction(style: .normal, title: "\u{1F4D3}\n Btn2") { action, index in
     //code

    }

    Btn2.backgroundColor = UIColor.orange


    return [Btn2,Btn1]
}
Lalit Pratap
  • 119
  • 1
  • 11
  • also give tableview == table1 or table 2 than try. – MRizwan33 Mar 27 '18 at 10:54
  • I tried that but not working. – Lalit Pratap Mar 27 '18 at 11:07
  • 1
    I found the solution to this problem , If any one facing the same problem for those I want share that. This problem I was facing due to AutoResizing , ScrollView and tableView AutoResizing conflict to each other I change that accordingly than it worked properly . Thanks – Lalit Pratap Jun 13 '18 at 17:33

0 Answers0