Question

Is there any way that I can add a dummy cell with data until the app fetches the real data from the server, then delete it and replace it with real data?

I'm doing this because it takes too long to go and get the data and it is supposed to be a chatroom.

Was it helpful?

Solution

Yes, you can do this. For example, if you're using an array to populate your UITableView, you can fill that array with the dummy data; then when you receive the real data from the server, you can replace the dummy data at the appropriate indices then call reloadData to reload the table and update the cells with the correct data.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top