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 ...
- Collect data asynchronously
- Start the spinner immediately after the start of a fetch
- 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
Post a Comment