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

Declared In

RBSearchBarView.h

  cancelButtonEnabled

Whether or not a cancel button should be provided.

@property (nonatomic) BOOL cancelButtonEnabled

Declared In

RBSearchBarView.h

  shouldCloseKeyboardOnSearch

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

@property (nonatomic) BOOL shouldCloseKeyboardOnSearch

Declared In

RBSearchBarView.h

  margin

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

@property (nonatomic) UIEdgeInsets margin

Declared In

RBSearchBarView.h

  spacing

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

@property (nonatomic) CGFloat spacing

Declared In

RBSearchBarView.h

  queryString

Gets or sets the current query string.

@property (nonatomic, nullable) NSString *queryString

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.

Declared In

RBSearchBarView.h

  animator

The RBAnimator object to use when animating state changes.

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

Declared In

RBSearchBarView.h

  isActivated

Whether or not the search bar is currently activated.

@property (nonatomic, readonly) BOOL isActivated

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.

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.

Declared In

RBSearchBarView.h

  keyboardIsOpen

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

@property (nonatomic, readonly) BOOL keyboardIsOpen

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.

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.

Declared In

RBSearchBarView.h