Inserts new items at the given indexes in the given parent with the specified optional animations.
SDK
- macOS 10.7+
Framework
- App
Kit
Declaration
func insertItems(at indexes: Index Set, inParent parent: Any?, withAnimation animationOptions: NSTable View.Animation Options = [])
Parameters
indexes
Indexes at which to insert items.
parent
The parent for the items, or
nil
if the parent is the root.animationOptions
Animated slide effects used when inserting items.
Discussion
This method parallels the insert
method of NSTable
and is used in a way similar to the insert(_:
method of NSMutable
. The method does nothing if parent
is not expanded. The actual item values are determined by the data source’s outline
method (which is called only after end
to ensure data source integrity).
Note
NSCell
-based outline views must first call begin
before calling this method.
You can call this method multiple times within the same begin
/end
block; new insertions move previously inserted new items, just like modifying an array. Inserting an index beyond what is available throws an exception.