What is the correct behavior to delete an iPhone table row with an asynchronous server call?

I am working on adding functions to delete a row in a UITableView on iPhone. It’s pretty clear how to remove a line in an application, both from the model and from the user interface. However, uninstallation requires a call to the server, which cannot be guaranteed to be successful, given all the difficulties that may occur with a mobile connection. I implement both scrolling to delete for single rows and switching the entire table to edit mode.

  • What behavior can be used in a UITableView / UITableViewCell to indicate a server call? I think it can be difficult with limited real estate.
  • If the user is allowed to delete other lines during the delete call?
  • What behavior is recommended for errors? Display UIAlertView?
+4
source share
1 answer
  • Change the view of the cell accessories to UIProgressView to show that some activity has occurred, and set networkActivityIndicatorVisible .
  • Since all interactions with the user interface take place in the main thread, you can allow the user to delete several lines at the same time. Just send the request in the background and do not let this user scroll and delete this line until the operation is completed.
  • For a quick and dirty solution, UIAlertView will work. A more elegant solution would be some kind that falls off the status bar with details or, possibly, adds a button to the cell, which, when the user clicks on it, gives them a reason why it fails. There are several solutions here.
+3
source

All Articles