ios - How to show loading spinner between two screens -


I have an app with two UITableViewControllers by clicking on a cell in the first table view Get data from the server and then moves the user to another table view.

When the user clicks, I am loading the data from the server and then shows the second table view. So in between is a fraction of a second interval because the data is loading from the server.

I would like to immediately show the "loading" spinner when the user clicks on a cell in the first table controller and the "loading" spinner disappears when the data is received from the server.

This is what I am currently doing:

  Class First Controller & lt; UITableViewController ... def tableView (Tableview, Selection RowToundPath: IndexPath) initAFNetworkingClient Colors.fetch (AFMotion :: Client, Data itself [indexPath.row] ["id"]) Data | Self.navigationController.pushViewController (SecondController.alloc.initWithData (Data, Self Data [indexPath.row]), Animated: True ... End End ...  

  1. Collect data asynchronously
  2. Start the spinner immediately after the start of a fetch
  3. Prevent the spinner when filling is complete.

Make sure to change the UI to the main thread.

  Transmitting_Assistant ( Dispatch_get_main_queue (), ^ {// home Thread job here}  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -