RBSearchBarView Class Reference

Inherits from UIView
Declared in RBSearchBarView.h

Overview

A search bar consisting of a text field and optionally a cancel button.

  delegate

A delegate to receive search and state change events.

@property (nonatomic, weak, nullable) id<RBSearchBarViewDelegate> delegate

Discussion

A delegate to receive search and state change events.

Declared In

RBSearchBarView.h

  cancelButtonEnabled

Whether or not a cancel button should be provided.

@property (nonatomic) BOOL cancelButtonEnabled

Discussion

Whether or not a cancel button should be provided.

Declared In

RBSearchBarView.h

  shouldCloseKeyboardOnSearch

Whether or not the keyboard should close when a search is performed.

@property (nonatomic) BOOL shouldCloseKeyboardOnSearch

Discussion

Whether or not the keyboard should close when a search is performed.

Declared In

RBSearchBarView.h

  margin

The margin to provide around the text field and cancel button in the view.

@property (nonatomic) UIEdgeInsets margin

Discussion

The margin to provide around the text field and cancel button in the view.

Declared In

RBSearchBarView.h

  spacing

The spacing to provide between the text field and the cancel button.

@property (nonatomic) CGFloat spacing

Discussion

The spacing to provide between the text field and the cancel button.

Declared In

RBSearchBarView.h

  queryString

Gets or sets the current query string.

@property (nonatomic, nullable) NSString *queryString

Discussion

Gets or sets the current query string.

Declared In

RBSearchBarView.h

– performSearchWithQuery:

Performs a search with the given query string. This notifies the delegate that a search has been requested.

- (void)performSearchWithQuery:(nonnull NSString *)queryString

Parameters

queryString

The query string to perform the search with.

Discussion

Performs a search with the given query string. This notifies the delegate that a search has been requested.

Declared In

RBSearchBarView.h

  animator

The RBAnimator object to use when animating state changes.

@property (nonatomic, readonly, nonnull) RBAnimator *animator

Discussion

The RBAnimator object to use when animating state changes.

Declared In

RBSearchBarView.h

  isActivated

Whether or not the search bar is currently activated.

@property (nonatomic, readonly) BOOL isActivated

Discussion

Whether or not the search bar is currently activated.

Declared In

RBSearchBarView.h

– activateWithAnimation:openKeyboard:completion:

Activates the search bar, revealing the cancel button and optionally opening the keyboard to edit the search query string.

- (void)activateWithAnimation:(BOOL)animated openKeyboard:(BOOL)openKeyboard completion:(nullable dispatch_block_t)completion

Parameters

animated

Whether or not the transition should be animated.

openKeyboard

Whether or not the keyboard should also be opened.

completion

An optional block to be called on completion.

Discussion

Activates the search bar, revealing the cancel button and optionally opening the keyboard to edit the search query string.

Declared In

RBSearchBarView.h

– deactivateWithAnimation:completion:

Deactivates the search bar, hiding the cancellation button and closing the keyboard.

- (void)deactivateWithAnimation:(BOOL)animated completion:(nullable dispatch_block_t)completion

Parameters

animated

Whether or not the transition should be animated.

completion

An optional block to be called on completion.

Discussion

Deactivates the search bar, hiding the cancellation button and closing the keyboard.

Declared In

RBSearchBarView.h

  keyboardIsOpen

Whether or not the keyboard is currently open editing the search query string.

@property (nonatomic, readonly) BOOL keyboardIsOpen

Discussion

Whether or not the keyboard is currently open editing the search query string.

Declared In

RBSearchBarView.h

– openKeyboardWithCompletion:

Opens the keyboard to edit the search query string.

- (void)openKeyboardWithCompletion:(nullable dispatch_block_t)completion

Parameters

completion

An optional block to be called when the keyboard has been opened.

Discussion

Opens the keyboard to edit the search query string.

Declared In

RBSearchBarView.h

– closeKeyboardWithCompletion:

Closes the keyboard if it is currently opened to edit the search query string.

- (void)closeKeyboardWithCompletion:(nullable dispatch_block_t)completion

Parameters

completion

An optional block to be called when the keyboard has been closed.

Discussion

Closes the keyboard if it is currently opened to edit the search query string.

Declared In

RBSearchBarView.h