leadingSwipeActionsConfigurationForRowAt crashes iOS swift

 Problem:

    func tableView(_ tableView: UITableView, leadingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {



}



While using the above funtion left to right swipe while in editing when

try to swipe another time app crashed.


Solution:


While your tableView is in editing if you tried one more time for

swipe it will conflict with the previous number of rows.So it will 

be crash.


Try to add the line with 


      if !tableView.isEditing {


}

then only proceed with your editing otherwise ignore it..The problem 

will be solved


 

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift