<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 23, 2016, at 3:09 PM, Brent Royal-Gordon &lt;<a href="mailto:brent@architechies.com" class="">brent@architechies.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">What is the better discriminator here? Sure, you could make Observer into a class that contains a closure, but how does that make anything better? It's an extra object to track and manage; it's an impediment to using trailing closure syntax with `addObserver`; it's more state you could accidentally share; it's additional memory and additional reference counting.</span></div></blockquote></div><br class=""><div class="">You get all these problems already if you have to hold on to the closure object to remove it—you have to track and manage the closure object; you can't use trailing closure syntax with `addObserver` if you have to first assign the closure somewhere else; you could accidentally share the closure; referencing the closure will keep all its captured state alive, even if the observed object goes away.</div><div class=""><br class=""></div><div class="">-Joe</div></div></div></div><br class=""></body></html>