Contents

isEnabled

A Boolean value indicating whether the search bar is in the enabled state.

Declaration

var isEnabled: Bool { get set }

Discussion

Set the value of this property to true to enable the search bar or false to disable it. An enabled search bar responds to user interactions; a disabled search bar ignores touch events and takes on a disabled appearance.

If the search bar is associated with a UINavigationItem with inline, then the minimized (icon-only) UISearchBar won’t grow to the text field while isEnabled is false.

The default value of this property is true for a newly created search bar. You can set the search bar’s initial enabled state in your storyboard file.

See Also

Configuring the search bar