iOS Developer Library

Developer

UIKit User Interface Catalog

Search Bar

Search Bar Attributes Inspector Reference

image: ../Art/uisearchbar_attributes_inspector.pdf

Search Term and Captions

image: ../Art/uisearchbar_attributes_inspector_group-searchterm_captions.pdf

Text

The initial search string.

Access: text.

Placeholder

The text that appears when there is no search string.

Access: placeholder.

Prompt

The text that appears above the text field.

Access: prompt.

Appearance

image: ../Art/uisearchbar_attributes_inspector_group-appearance.pdf

Style

The basic appearance of the search bar.

Selection

Method

Argument

Default

barStyle

UIBarStyleDefault

Black Opaque

barStyle

UIBarStyleBlack

Black Translucent

barStyle

UIBarStyleBlackTranslucent

Tint

The color of the search bar.

Access: tintColor.

Capabilities

image: ../Art/uisearchbar_attributes_inspector_group-capabilities.pdf

Shows Search Results Button

Whether the search bar displays the Search Results button.

Selection

Method

Argument

image: ../Art/user_interface_checkbox-unselected.pdf Unselected

showsSearchResultsButton

NO

image: ../Art/user_interface_checkbox-selected.pdf Selected

showsSearchResultsButton

YES

Shows Bookmarks Button

Whether the search bar displays the Bookmarks button.

Selection

Method

Argument

image: ../Art/user_interface_checkbox-unselected.pdf Unselected

showsBookmarkButton

NO

image: ../Art/user_interface_checkbox-selected.pdf Selected

showsBookmarkButton

YES

Shows Cancel Button

Whether the search bar displays the Cancel button.

Selection

Method

Argument

image: ../Art/user_interface_checkbox-unselected.pdf Unselected

showsCancelButton

NO

image: ../Art/user_interface_checkbox-selected.pdf Selected

showsCancelButton

YES

Shows Scope Bar

Whether the search bar displays the scope bar.

Selection

Method

Argument

image: ../Art/user_interface_checkbox-unselected.pdf Unselected

showsScopeBar

NO

image: ../Art/user_interface_checkbox-selected.pdf Selected

showsScopeBar

YES

Scope Titles

image: ../Art/uisearchbar_attributes_inspector_group-scope_titles.pdf

Scope Title List

The titles of the scope buttons in the scope bar.

Access: scopeButtonTitles.

Text Input

image: ../Art/uisearchbar_attributes_inspector_group-textinput.pdf

Capitalize

Whether and when the keyboard activates the Shift key while the user types text.

Selection

Method

Argument

None

autocapitalizationType

UITextAutocapitalizationTypeNone

Words

autocapitalizationType

UITextAutocapitalizationTypeWords

Sentences

autocapitalizationType

UITextAutocapitalizationTypeSentences

All Characters

autocapitalizationType

UITextAutocapitalizationTypeAllCharacters

Correction

Whether to auto-correct text the user types.

Selection

Method

Argument

Default

autocorrectionType

UITextAutocorrectionTypeDefault

No

autocorrectionType

UITextAutocorrectionTypeNo

Yes

autocorrectionType

UITextAutocorrectionTypeYes

Keyboard

The type of keyboard that appears on text input.

Selection

Method

Argument

Default

keyboardType

UIKeyboardTypeDefault

ASCII Capable

keyboardType

UIKeyboardTypeASCIICapable

Numbers and Punctuation

keyboardType

UIKeyboardTypeNumbersAndPunctuation

URL

keyboardType

UIKeyboardTypeURL

Number Pad

keyboardType

UIKeyboardTypeNumberPad

Phone Pad

keyboardType

UIKeyboardTypePhonePad

E-mail Address

keyboardType

UIKeyboardTypeEmailAddress