---
title: "addSplitViewItem(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nssplitviewcontroller/addsplitviewitem(_:)"
---

# addSplitViewItem(_:)

Adds a split view item to the end of the array of split view items.

## Declaration

```swift
func addSplitViewItem(_ splitViewItem: NSSplitViewItem)
```

## Parameters

- `splitViewItem`: The split view item to add. important: Before you add a split view item, it must be non-nil and it must have an associated view controller, or the system throws an exception.

## Discussion

Discussion This is a convenience method you can use in place of the insertSplitViewItem(_:at:) method when you want to add a split view item to the end of the splitViewItems array. Calling this method implicitly calls the insertSplitViewItem(_:at:) method. If you subclass the NSSplitViewController class, don’t call this method in your custom object to add a split view item. Instead, call the insertSplitViewItem(_:at:) method directly.

## See Also

### Modifying a Split View Controller

- [insertSplitViewItem(_:at:)](appkit/nssplitviewcontroller/insertsplitviewitem(_:at:).md)
- [removeSplitViewItem(_:)](appkit/nssplitviewcontroller/removesplitviewitem(_:).md)
