<div dir="ltr">Charles,<div><br></div><div>I think this is interesting. And discussion on replacing/updating NSProgress is important.</div><div><br></div><div>Just a note: optional parameters make this possible without changing the language. A very rough example follows:</div><div><br></div><div>func delete(files: FileList, withProgress progress: Progress? = nil) {</div><div> progress.totalUnits = 10</div><div> print("Getting started")</div><div> progress.completedUnits = 5 // that was easy!</div><div> actuallyDelete(files, withProgress: progress.childWithUnits: 5)</div><div>}</div><div><br></div><div>let progress = Progress()</div><div>// watch progress.totalPortion using KVO 2.0</div><div>delete(files: allTheFiles, withProgress: progress)</div><div><br></div><div>Regards,</div><div>Will</div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Jan 17, 2016 at 9:42 PM, Charles Srstka via swift-evolution <span dir="ltr"><<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Typo here: This should have said "on the current thread." The fact that NSProgress bogs down the worker thread with the work involved in creating the KVO notifications is part of my issue with it.<span class="HOEnZb"><font color="#888888"><br>
<br>
Charles</font></span><span class="im HOEnZb"><br>
<br>
On 2016-01-17 21:14, Charles Srstka via swift-evolution wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
5. NSProgress posts KVO notifications on the main thread.<br>
</blockquote>
<br></span><div class="HOEnZb"><div class="h5">
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</div></div></blockquote></div><br></div>