SFormChoiceField Class Reference

Inherits from SFormField : NSObject
Declared in SFormChoiceField.h
Availability
Related samples

Overview

A field for choosing from set of options.

This class represents a field model where multiple choices are available, but only one choice may be selected by the user. For example, a “Gender” field that provides the choices “Male” and “Female”.

This field type returns an NSNumber as its field value representing the index (in choices) of the currently selected choice.

This class is compatible with validators that conform to SFormChoiceFieldValidator.

Properties

choices

The choices that should be presented to the user via view.

@property (nonatomic, strong) NSArray *choices

Discussion

This should be an array of NSString or UIImage objects.

Declared In

SFormChoiceField.h

value

The current value of the field.

@property (nonatomic, copy) NSNumber *value

Discussion

This is the index of the currently selected option.

Declared In

SFormChoiceField.h

Instance Methods

initWithTitle:choices:

Create a choice field with the given title and choices.

- (instancetype)initWithTitle:(NSString *)title choices:(NSArray *)choices

Parameters

title

The field’s title.

choices

The choices that should be presented to the user via view.

Discussion

This is the designated initializer.

Declared In

SFormChoiceField.h