New to NSURLSessionTask
in iOS11 is a progress
property:
A representation of the overall task progress
@property(readonly, strong) NSProgress *progress;
When queried while at 781334 of 1025886 bytes, the output is like this:
<NSProgress: 0x1c0324ec0> : Parent: 0x0 / Fraction completed: 0.0000 / Completed: 0 of 1025886
<NSProgress: 0x1c0325140> : Parent: 0x1c0324ec0 / Fraction completed: 0.0000 / Completed: 781334 of -1
<NSProgress: 0x1c03251e0> : Parent: 0x1c0324ec0 / Fraction completed: 0.0000 / Completed: 0 of 100
Note the fractionCompleted
being 0.000 instead of 0.762.
When the data task finishes, the output of it's progress
property looks like this:
<NSProgress: 0x1c4131440> : Parent: 0x0 / Fraction completed: 0.0000 / Completed: 5 of 1142597
<NSProgress: 0x1c4131580> : Parent: 0x1c4131440 / Fraction completed: 0.0000 / Completed: -1 of -1
Note Completed: 5 of 1142597
.
NSURLSessionTask
's progress reporting appears to be totally useless. So in order to report progress to a UI in iOS11, I still have to write the same boilerplate code as before. So what is the purpose of this new property?