---
title: "setScopeBarButtonDividerImage(_:forLeftSegmentState:rightSegmentState:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uisearchbar/setscopebarbuttondividerimage(_:forleftsegmentstate:rightsegmentstate:)"
---

# setScopeBarButtonDividerImage(_:forLeftSegmentState:rightSegmentState:)

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

## Declaration

```swift
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 doc://com.apple.uikit/documentation/UIKit/UIControl/State-swift.struct/normal or doc://com.apple.uikit/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 doc://com.apple.uikit/documentation/UIKit/UIControl/State-swift.struct/normal or doc://com.apple.uikit/documentation/UIKit/UIControl/State-swift.struct/selected.

## Discussion

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).

## See Also

### Customizing the scope bar appearance

- [scopeBarBackgroundImage](uikit/uisearchbar/scopebarbackgroundimage.md)
- [scopeBarButtonBackgroundImage(for:)](uikit/uisearchbar/scopebarbuttonbackgroundimage(for:).md)
- [setScopeBarButtonBackgroundImage(_:for:)](uikit/uisearchbar/setscopebarbuttonbackgroundimage(_:for:).md)
- [scopeBarButtonDividerImage(forLeftSegmentState:rightSegmentState:)](uikit/uisearchbar/scopebarbuttondividerimage(forleftsegmentstate:rightsegmentstate:).md)
- [scopeBarButtonTitleTextAttributes(for:)](uikit/uisearchbar/scopebarbuttontitletextattributes(for:).md)
- [setScopeBarButtonTitleTextAttributes(_:for:)](uikit/uisearchbar/setscopebarbuttontitletextattributes(_:for:).md)
