---
title: "init(alertStyleWithIdentifier:)"
framework: appkit
role: symbol
role_heading: Initializer
path: "appkit/nsgrouptouchbaritem/init(alertstylewithidentifier:)"
---

# init(alertStyleWithIdentifier:)

Initializes and returns a group item configured to match system alerts.

## Declaration

```swift
convenience init(alertStyleWithIdentifier identifier: NSTouchBarItem.Identifier)
```

## Discussion

Discussion You can control spacing between items, but it is recommended to use fixedSpaceLarge to maintain consistency. The groupUserInterfaceLayoutDirection is set to match the application’s userInterfaceLayoutDirection.

## See Also

### Creating a group

- [init(identifier:items:)](appkit/nsgrouptouchbaritem/init(identifier:items:).md)
- [init(identifier:items:allowedCompressionOptions:)](appkit/nsgrouptouchbaritem/init(identifier:items:allowedcompressionoptions:).md)
