---
title: "setScopeBarButtonTitleTextAttributes(_:for:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uisearchbar/setscopebarbuttontitletextattributes(_:for:)"
---

# setScopeBarButtonTitleTextAttributes(_:for:)

Sets the text attributes for the search bar’ button’s title string for a given state.

## Declaration

```swift
func setScopeBarButtonTitleTextAttributes(_ attributes: [NSAttributedString.Key : Any]?, for state: UIControl.State)
```

## Parameters

- `attributes`: A dictionary containing key-value pairs specifying the text attributes to use for state. You may specify the font, text color, text shadow color, and text shadow offset, using the keys found in NSString UIKit Additions Reference.
- `state`: A control state.

## 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)
- [setScopeBarButtonDividerImage(_:forLeftSegmentState:rightSegmentState:)](uikit/uisearchbar/setscopebarbuttondividerimage(_:forleftsegmentstate:rightsegmentstate:).md)
- [scopeBarButtonTitleTextAttributes(for:)](uikit/uisearchbar/scopebarbuttontitletextattributes(for:).md)
