Thursday, February 22, 2024
HomeiOS Developmentios - What causes process.progress.observe(.fractionCompleted) to behave very poorly, throwing solely two...

ios – What causes process.progress.observe(.fractionCompleted) to behave very poorly, throwing solely two fractions, one initially and one on the finish?


For a totally regular name getting a big file from the online,

let process = URLSession.shared.dataTask(with: request) { [weak self] (knowledge, response, error) in

Previously I’ve all the time added progress merely like this,

process.resume()
obs = process.progress.observe(.fractionCompleted) { progress, _ in
    print("frac ", progress.fractionCompleted)
}

And it has all the time labored nice.

Nevertheless today it doesn’t matter what I attempt, I simply get

enter image description here

You get a ridiculous report at about 1%,

and a ridiculous report at about 95%,

and that is it, nothing in between.

Similar occurs if 100kb, 1mb or 200mb obtain.

You get the 1% report when it begins, nothing occurs for minutes, or an hour, then it tells you “95% !” after which it’s accomplished.

In case you use a timer to examine .progress the end result is similar, it’s simply caught on principally 0 till the tip, then 100.

Learn how to get common progress stories??



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments