SFormNavigationToolbar Protocol Reference

Conforms to NSObject
Declared in SFormNavigationToolbar.h
Availability
Related samples

Overview

The protocol SFormNavigationToolbar defines the methods needed for a navigation compatable toolbar.

The built in ShinobiForm navigation allows users to move between fields easily without having to physically tap on a field. A UIView implementing these methods as advised will be compatable with the out of the box navigation.

Instance Methods

fieldView:becameFirstResponderHasPrevious:hasNext:

Called when a field view is selected.

- (void)fieldView:(SFormFieldView *)fieldView becameFirstResponderHasPrevious:(BOOL)hasPrevious hasNext:(BOOL)hasNext

Discussion

Here the toolbar is given information about the newly focused field view. The toolbar is also given information as to whether there are any field views previous or next to the newly selected field view, allowing the toolbar to enable/disable navigation buttons.

Declared In

SFormNavigationToolbar.h

setFieldNavigator:

Set object responsible for navigating between fields of the form.

- (void)setFieldNavigator:(id<SFormNavigator>)fieldNavigator

Discussion

You can tell the toolbar’s field navigator to focus on the previous or next field by calling focusPreviousField or focusNextField respectively.

If you want your toolbar to be compatible with the built in navigation then you need to store the fieldNavigator provided and call it when you wish to navigate between feilds.

Declared In

SFormNavigationToolbar.h

toolbarView

Returns the toolbar view.

- (UIView *)toolbarView

Discussion

This method should return the UIView toolbar. Simply return self if your toolbar is the object implementing this protocol.

Declared In

SFormNavigationToolbar.h