I have a UIProgressView
which is used to show to the user the progress of a file download. The download request is done in a background thread, and in the progress block, the UIProgressView
progress value update is called on the main thread.
It works well to around 40%, but then it hangs and quickly shows up at around 100% and the custom alert closes (as it should). I tried multiple times but I can't get it to smoothly update to 100%.
I also have a cancel button, which I noticed that it doesn't respond to taps in that 40% - 100% range. So, somehow, the main thread gets blocked. Because in the 0% - 40% range, the cancel button works perfectly. I am very sure I don't block the main thread with the file download, and that the UIProgressView
update is done on the main thread.
What could be the problem?