<!--
{
  "availability" : [
    "iOS: 5.0.0 -",
    "iPadOS: 5.0.0 -",
    "macCatalyst: 13.1.0 -",
    "tvOS: -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UISearchBar/setScopeBarButtonDividerImage(_:forLeftSegmentState:rightSegmentState:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:objc(cs)UISearchBar(im)setScopeBarButtonDividerImage:forLeftSegmentState:rightSegmentState:"
  },
  "title" : "setScopeBarButtonDividerImage(_:forLeftSegmentState:rightSegmentState:)"
}
-->

# setScopeBarButtonDividerImage(_:forLeftSegmentState:rightSegmentState:)

Sets the divider image to use for a given combination of left and right segment states.

```
func setScopeBarButtonDividerImage(_ dividerImage: UIImage?, forLeftSegmentState leftState: UIControl.State, rightSegmentState rightState: UIControl.State)
```

## Parameters

`dividerImage`

The divider image to use for the combination of `leftState` and `rightState`.

`leftState`

The state of the left segment for which to set the divider image.

    The state may be [`normal`](/documentation/UIKit/UIControl/State-swift.struct/normal)     or [`selected`](/documentation/UIKit/UIControl/State-swift.struct/selected)    .

`rightState`

The state of the right segment for which to set the divider image.

    The state may be [`normal`](/documentation/UIKit/UIControl/State-swift.struct/normal)     or [`selected`](/documentation/UIKit/UIControl/State-swift.struct/selected)    .

## Discussion

To customize the segmented control appearance you need to provide divider images to go between two unselected segments (`leftSegmentState:UIControlStateNormal rightSegmentState:UIControlStateNormal`), selected on the left and unselected on the right (`leftSegmentState:UIControlStateSelected rightSegmentState:UIControlStateNormal`), and unselected on the left and selected on the right (`leftSegmentState:UIControlStateNormal rightSegmentState:UIControlStateSelected`).

---

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)