How can I show a progress bar in iOS app while my data is being downloaded synchronously from the server?
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.
You can’t. When you fetch data synchronously, the fetching happens in the main thread and it blocks it while fetching and the UI uses the main thread to update itself, so until the fetching is complete you can’t update anything on the UI. You should fetch asynchronously (in another thread) and update the UI (which runs on the main thread) on some checkpoints.