---
title: showsCancelButton
framework: uikit
role: symbol
role_heading: Instance Property
path: uikit/uisearchbar/showscancelbutton
---

# showsCancelButton

A Boolean value indicating whether the cancel button is displayed.

## Declaration

```swift
var showsCancelButton: Bool { get set }
```

## Discussion

Discussion When the value of this property is true, the cancel button is displayed if the app is running on iPhone. The value of this property is ignored, and no cancel button is displayed, for apps running on iPad. The default value is false.

## See Also

### Configuring the search interface

- [showsBookmarkButton](uikit/uisearchbar/showsbookmarkbutton.md)
- [setShowsCancelButton(_:animated:)](uikit/uisearchbar/setshowscancelbutton(_:animated:).md)
- [showsSearchResultsButton](uikit/uisearchbar/showssearchresultsbutton.md)
- [isSearchResultsButtonSelected](uikit/uisearchbar/issearchresultsbuttonselected.md)
