I have a UIPageViewController that have UITableViewControllers inside it, and the swipe left gestures are conflicted between the UIPageViewCo
In my case (swift 3, iOS11) MGSwipeTableCell works perfect. You can configure call's buttons in
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: prettyIdentifier, for: indexPath)
cell.allowsButtonsWithDifferentWidth = true
cell.rightButtons = [MGSwipeButton(title: "Delete\npermanently", backgroundColor: #colorLiteral(red: 0.9745360017, green: 0.7205639482, blue: 0.3932176828, alpha: 1)), MGSwipeButton(title: "Undo",backgroundColor: .black)]
cell.rightSwipeSettings.transition = .rotate3D
cell.delegate = self
return cell
}
instead of
func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {...}
and catch touches in
extension RecordingViewController: MGSwipeTableCellDelegate {
func swipeTableCell(_ cell: MGSwipeTableCell, tappedButtonAt index: Int, direction: MGSwipeDirection, fromExpansion: Bool) -> Bool {
cell.hideSwipe(animated: true)
// do your stuff here like
if index == 0 {
print("right button")
}
return true
}
}