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]
}