<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIBarButtonItemGroup/optionalGroup(customizationIdentifier:isInDefaultCustomization:representativeItem:items:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:So20UIBarButtonItemGroupC5UIKitE08optionalD023customizationIdentifier24isInDefaultCustomization014representativeC05itemsABSS_SbSo0abC0CSgSayAJGtFZ"
  },
  "title" : "optionalGroup(customizationIdentifier:isInDefaultCustomization:representativeItem:items:)"
}
-->

# optionalGroup(customizationIdentifier:isInDefaultCustomization:representativeItem:items:)

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

```
@MainActor @preconcurrency class func optionalGroup(customizationIdentifier: String, isInDefaultCustomization: Bool = true, representativeItem: UIBarButtonItem? = nil, items: [UIBarButtonItem]) -> 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.

`representativeItem`

The item to display for the group when space is constrained.

`items`

The items to include in the group.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)