I have a so heavy view that takes two seconds or more seconds to load. I would like to show activity indicator while be carrying all things at the viewDidLoad and then hide it. Can someone guide me to do this? Thanks in advance.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t know for sure but I doubt that it’s possible to run viewDidLoad on a background thread. If this is true you have no way to animate an activity indicator when running viewDidLoad.
So If I were you I would figure out what takes viewDidLoad so long, and put this into a method that can run in the background.
Then add a activity indicator view in your viewWillAppear method and remove it when your background task is complete.
Depending on the stuff you do in viewDidLoad this might require a lot of refactoring and adding of delegate methods.
I guess you are downloading something that should be displayed.