Open KhaVNguyen opened 8 years ago
I had the same issue. Use insertRowsAtIndexPaths, reloadRowsAtIndexPaths, deleteRowsAtIndexPaths instead reloadData and before reloadRowsAtIndexPaths check the swipeOffset of the current MGSwipeTableCell; if it's true the swipe is activated so don't reload that cell for keep the swipe. I hope this answer help you.
- Prevent the MGSwipeTableViewCells from unswiping upon calling tableView.reloadData()
You could save the swipeOffset of each visible cell and restore the values after calling reloadData.
- Access the method called when the swipe gesture is began in order to temporarily pause my background process and subsequently stop calling tableView.reloadData() while a swipe action is being done.
You can use this delegate methods:
-(void) swipeTableCellWillBeginSwiping:(MGSwipeTableCell ) cell; -(void) swipeTableCellWillEndSwiping:(MGSwipeTableCell *) cell; -(void) swipeTableCell:(MGSwipeTableCell) cell didChangeSwipeState:(MGSwipeState) state gestureIsActive:(BOOL) gestureIsActive;
I have a process in the background that modifies realm, which causes the table view to constantly reload data when it is running. The problem with this is that as the table view is constantly reloaded, the MGSwipeTableViewCells in my table view are also reloaded and are forced to the unswiped position.
Is there a way either:
Thanks for the help.