DeclarativeHub / Bond

A Swift binding framework
MIT License
4.23k stars 361 forks source link

ObjectTreeNode clones nesting? #588

Open tonyarnold opened 5 years ago

tonyarnold commented 5 years ago

I'm wiring up an NSOutlineView to a tree that has the following signature:

TreeNode<Array2DElement<SectionType, ItemType>>

However, the outline view is receiving items with the signature:

ObjectTreeNode<TreeNode<Array2DElement<SectionType, ItemType>>>

This is proving quite unwieldily in use - I know the Object-based nodes are necessary, but is it necessary for them to wrap the original node, and not it's value?

I would have expected the clone to have the following signature:

ObjectTreeNode<Array2DElement<SectionType, ItemType>>
srdanrasic commented 5 years ago

To be honest I can't remember if there was any specific reason for this. Feel free to try to improve it, I don't think it should be too much work.

tonyarnold commented 5 years ago

@srdanrasic do you recall what happened if value types were used with NSOutlineView and NSTableView (ie. TreeNode instead of ObjectTreeNode)? Was it an easily visible issue?

srdanrasic commented 5 years ago

I think what happened is that updates didn't get reflected in the view.