---
title: "creatingOptionalGroup(customizationIdentifier:isInDefaultCustomization:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uibarbuttonitem/creatingoptionalgroup(customizationidentifier:isindefaultcustomization:)"
---

# creatingOptionalGroup(customizationIdentifier:isInDefaultCustomization:)

Places the item in an optional group that a person can move, add to, or remove from the navigation bar during layout customization.

## Declaration

```swift
@MainActor @preconcurrency func creatingOptionalGroup(customizationIdentifier: String, isInDefaultCustomization: Bool = true) -> UIBarButtonItemGroup
```

## Parameters

- `customizationIdentifier`: A unique string to identify the group for navigation bar layout customization.
- `isInDefaultCustomization`: A Boolean that determines whether to place the group in the navigation bar by default. Specify doc://com.apple.documentation/documentation/Swift/false if you want the group to appear in the navigation bar customization popover by default.

## Return Value

Return Value A UIBarButtonItemGroup that contains only this bar button item.

## Discussion

Discussion A bar button item can only belong to one UIBarButtonItemGroup. If you add a bar button item to a new group, the system removes it from its previous group.

## See Also

### Creating groups

- [creatingFixedGroup()](uikit/uibarbuttonitem/creatingfixedgroup().md)
- [creatingMovableGroup(customizationIdentifier:)](uikit/uibarbuttonitem/creatingmovablegroup(customizationidentifier:).md)
