Domanda

I have a ViewController that requires a lot of data to be generated, this takes 5 seconds.

So the user doesn't think they haven't pressed the loading Tab the view appears immediately as I have kept ViewDidLoad sparse and the calculating routines are in ViewDidAppear. But it still takes 5 seconds for the results to materialise.

What is the mechanism for incrementally updating a label?

È stato utile?

Soluzione

This is a pretty localized question and really depends on what your code looks like and what you're comfortable with doing.

If this were my code, I'd use either a timer (for predictable, periodic updating) or a delegate method to get a label to periodically update. I might also show a UIActivityIndicator view adjacent to the label to show that an update is impending for it.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top