Re: [swift-users] What is the intended response to Array change notification for dependents?

2017-03-07 Thread Michael Gardner via swift-users
> On Mar 7, 2017, at 10:14, Jens Alfke wrote: > > >> On Mar 7, 2017, at 9:28 AM, Michael Gardner via swift-users >> wrote: >> >> The general approach would be to run a diff between your old and new arrays. >> Something like

Re: [swift-users] What is the intended response to Array change notification for dependents?

2017-03-07 Thread Jens Alfke via swift-users
> On Mar 7, 2017, at 9:28 AM, Michael Gardner via swift-users > wrote: > > The general approach would be to run a diff between your old and new arrays. > Something like https://github.com/jflinter/Dwifft > could help, though I

Re: [swift-users] What is the intended response to Array change notification for dependents?

2017-03-07 Thread Michael Gardner via swift-users
The general approach would be to run a diff between your old and new arrays. Something like https://github.com/jflinter/Dwifft could help, though I haven't used it personally. Another approach is to build a wrapper around your source array with limited modification methods and a KVO-like

Re: [swift-users] What is the intended response to Array change notification for dependents?

2017-03-07 Thread Jens Alfke via swift-users
> On Mar 7, 2017, at 8:45 AM, Edward Connell wrote: > > My project is on Linux, so pure Swift. > So you don't think this is an issue of intentional library design, but a > recognized problem that hasn't been addressed yet? Exactly. —Jens

Re: [swift-users] What is the intended response to Array change notification for dependents?

2017-03-07 Thread Edward Connell via swift-users
My project is on Linux, so pure Swift. So you don't think this is an issue of intentional library design, but a recognized problem that hasn't been addressed yet? Thanks, Ed On Tue, Mar 7, 2017 at 8:13 AM, Jens Alfke wrote: > > On Mar 7, 2017, at 8:08 AM, Edward Connell

Re: [swift-users] What is the intended response to Array change notification for dependents?

2017-03-07 Thread Jens Alfke via swift-users
> On Mar 7, 2017, at 8:08 AM, Edward Connell wrote: > > My question is, what was their design intent? Rebuild all dependents every > time? Swift started out by piggybacking on facilities provided by Foundation. Over time it’s becoming self-sufficient, but it’s a work in

Re: [swift-users] What is the intended response to Array change notification for dependents?

2017-03-07 Thread Edward Connell via swift-users
Thank you Jens, that is exactly the point of my question. At the moment in pure swift there is no incremental array change API for observers. This must have been considered by the library designers. My question is, what was their design intent? Rebuild all dependents every time? Sent from my

Re: [swift-users] What is the intended response to Array change notification for dependents?

2017-03-07 Thread Jens Alfke via swift-users
On Mar 6, 2017, at 11:36 PM, Rien via swift-users wrote: > On 07 Mar 2017, at 03:56, Edward Connell via swift-users > > wrote: > > I would like to have an Array implementation where I get more information > than just

Re: [swift-users] What is the intended response to Array change notification for dependents?

2017-03-06 Thread Rien via swift-users
I don’t think there is a single answer to this. It is all highly dependant on what the application does with the info. Sometimes it will indeed be necessary to rebuild the entire gui, other times it is enough to simply insert a new table cell. Regards, Rien Site: http://balancingrock.nl Blog:

[swift-users] What is the intended response to Array change notification for dependents?

2017-03-06 Thread Edward Connell via swift-users
I would like to have an Array implementation where I get more information than just "the whole thing changed". 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