Adds the specified object to the tree.
- iOS 10.0+
- macOS 10.12+
- Mac Catalyst 13.0+
- tvOS 10.0+
The object to be added to the tree.
The corner (with the lowest x- and y-coordinate values) of the bounding region occupied by the object.
The corner (with the highest x- and y-coordinate values) of the bounding region occupied by the object.
An option specifying the algorithm the tree should use to optimize its internal structure after adding the new element.
The bounding region of each object you add to the tree (specified with the
bounding parameters) defines the location and size of that object in space. When you add an object, depending on the relation of that size and position to those of other objects in the tree, the tree may reorganize its internal structure so that later searches of the tree (with the
elements) can perform more quickly.
split parameter controls how the tree reorganizes its internal structure when needed—you can use a different strategy each time you add an object. Which strategy provides the best performance depends on the organization of data in your app or game; for best results, experiment with different strategies and profile your app’s performance with each.