You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for a quick response. Today I tried the 1.26, but I had to revert back, due to NSProgress. In the meantime, I have implemented NSProgress on my own, let me explain how. After that I have some suggestions how to improve SOAPEngine's handling of NSProgress. The food for discussion, hopefully.
1 Create a progress object in a view controller with KVO hooked on this progress object and listening to "fractionCompleted" in order to show progress to the user.
self.progress=NSProgress(totalUnitCount:1)self.progress?.becomeCurrentWithPendingUnitCount(1)
//now fire SOAP request elsewhere
self.progress?.resignCurrent()
2 Here is a fire SOAP request part, elsewhere in the app. Here is created another NSProgress object, with current one from 1. set as parent. This helps to decouple the UI part from the network part of the app.
3 The last step is to update this child NSProgress object in sendedDataSize
sendedDataSize:{(uploaded:UInt,total:UInt)inprint("uploaded \(uploaded) from \(total) bytes")self.progress?.completedUnitCount=Int64(total)}
Suggestions:
make sure, that you create your NSProgress object with parent: NSProgress.currentProgress(), so that possible UI clients can be wired automatically
make sure, that you create your NSProgress object until the requestURL.. family of functions return. For parent (="UI client") NSProgress it is crucial to resignCurrent() asap, to avoid possible interferences with system libraries. That is why yours should be created early.
3 a very nice feature of NSProgress is a decoupled cancelling of the task. It would be nice, if you provided a hook for setting external cancellationHandler.
4 maybe for those, who have hierarchies of NSProgress objects, or some wild configuration requirements, you might add a possibility to disable your NSProgress object (?)
NSProgress is amazing addition, and it would be great if we figure out how to make the best of it :)
Activity
priore commentedon Feb 17, 2016
We just released the new version 1.26 of the framework 017ccf1
VilemKurz commentedon Feb 24, 2016
Thank you for a quick response. Today I tried the 1.26, but I had to revert back, due to NSProgress. In the meantime, I have implemented NSProgress on my own, let me explain how. After that I have some suggestions how to improve SOAPEngine's handling of NSProgress. The food for discussion, hopefully.
1 Create a progress object in a view controller with KVO hooked on this progress object and listening to "fractionCompleted" in order to show progress to the user.
2 Here is a fire SOAP request part, elsewhere in the app. Here is created another NSProgress object, with current one from 1. set as parent. This helps to decouple the UI part from the network part of the app.
Then SOAPEngine object is created, configured and fired. I make some last minute changes in
3 The last step is to update this child NSProgress object in sendedDataSize
Suggestions:
parent: NSProgress.currentProgress(), so that possible UI clients can be wired automatically3 a very nice feature of NSProgress is a decoupled cancelling of the task. It would be nice, if you provided a hook for setting external cancellationHandler.
4 maybe for those, who have hierarchies of NSProgress objects, or some wild configuration requirements, you might add a possibility to disable your NSProgress object (?)
NSProgress is amazing addition, and it would be great if we figure out how to make the best of it :)