---
title: "toolbarWillAddItem(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstoolbardelegate/toolbarwilladditem(_:)"
---

# toolbarWillAddItem(_:)

Tells the delegate that the toolbar is about to add the specified item.

## Declaration

```swift
@MainActor optional func toolbarWillAddItem(_ notification: Notification)
```

## Parameters

- `notification`: A notification named doc://com.apple.appkit/documentation/AppKit/NSToolbar/willAddItemNotification.

## Discussion

Discussion Use this method to cache references to new toolbar items or perform any tasks related to the addition of those items.

## See Also

### Adding and removing items

- [toolbar(_:itemForItemIdentifier:willBeInsertedIntoToolbar:)](appkit/nstoolbardelegate/toolbar(_:itemforitemidentifier:willbeinsertedintotoolbar:).md)
- [toolbarDidRemoveItem(_:)](appkit/nstoolbardelegate/toolbardidremoveitem(_:).md)
- [NSToolbar.Identifier](appkit/nstoolbar/identifier-swift.typealias.md)
