Interestingly, this is a good OOP principle if there is a UITreeViewand in the iOS application UINodeViewand the object UITreeViewhas rootNodeView, and this root node is off. using leftChildNodeViewand rightChildNodeView.
If each object UINodeViewcan be βdragged and dropped,β any where on the screen that is implemented in the handler UINodeView -touchesMovedis a good OOP principle? In addition, if the new nodeView is fooreally close to one of the nodes that does not have a left or right child, the node foocan be added to this node as a child.
And I suppose that if there is another nodeView that is bar, and also has no parents (that is, also hangs out), it makes sense that fooyou can add as barchild.
If this foonodeView "requests permission from a node to add as a left or right child" and "adds it if allowed", or if UIViewControlleror UITreeViewdetects that a node moves inside itself and "decides that it is close to another node (all nodes on the screen) and does not have a left or right child and adds fooas a child "?
Obviously, if only the node tree in the tree can add a child element of a node, then it UITreeViewcan complete the task, but if any node (hanging or not) can be a parent, then UIViewControllereither the main view UIViewseems to do the job.
Does this somehow violate the good principles of OOP?
source
share