<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Thank you Jens, that is exactly the point of my question.&nbsp;</div><div id="AppleMailSignature">At the moment in pure swift there is no incremental array change API for observers. This must have been considered by the library designers.&nbsp;</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">My question is, what was their design intent? Rebuild all dependents every time?</div><div id="AppleMailSignature"><br><br>Sent from my iPhone</div><div><br>On Mar 7, 2017, at 7:59 AM, Jens Alfke &lt;<a href="mailto:jens@mooseyard.com">jens@mooseyard.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><meta http-equiv="Content-Type" content="text/html charset=utf-8"><br class=""><div><div class="">On Mar 6, 2017, at 11:36 PM, Rien via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><blockquote type="cite" style="font-family: Alegreya-Regular; font-size: 15px; font-style: normal; font-variant-caps: 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-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">On 07 Mar 2017, at 03:56, Edward Connell via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:<br class=""><br class="">I would like to have an Array implementation where I get more information than just "the whole thing changed".<span class="Apple-converted-space">&nbsp;</span><br class="">As a value type I get it, but lets say it's a list of 500 image info structs and it's bound to UI. You change one item, now the whole array changes and you have to rebuild the entire visual tree right? Rebuilding the state of dependent objects can be really expensive, not just UI things.<br class=""></blockquote></div></div><br class=""><div class="">In Apple’s Foundation framework, Key-Value Observing (KVO) fills this need, and can be used with NSMutableArray, including when it’s bridged to Swift. But it doesn’t really transfer to a pure Swift environment since arrays are value types: changing one item is actually replacing the entire array with a new one (optimized through clever internal data-sharing.)</div><div class=""><br class=""></div><div class="">I would assume that the people working on the design of the Swift Foundation library are thinking about similar observer APIs, but I don’t know the details.</div><div class=""><br class=""></div><div class="">—Jens</div></div></blockquote></body></html>