Index

RBMultipleChoiceView.h

Protocols

Classes


RBMultipleChoiceViewOption

An item for a multiple choice field.

Properties

The value of the item.
public value NSString { get }

The display text of the item.
public displayText NSString? { get }

The display image of the item.
public displayImage UIImage? { get }

Functions

Initializes the item.
@param value : The value of the item.
@param displayText : The display text of the item.
@returns The initialized item.
- (nonnull instancetype)initWithValue:(nonnull NSString *)value displayText:(nonnull NSString *)displayText;

Initializes the item.
@param value : The value of the item.
@param displayText : The display text of the item.
@param displayImage : The display image of the item.
@returns The initialized item.
- (nonnull instancetype)initWithValue:(nonnull NSString *)value displayText:(nullable NSString *)displayText displayImage:(nullable UIImage *)displayImage;


RBMultipleChoiceView

A multiple choice field.

Properties

A delegate to receive item selection events.
public weak delegate RBMultipleChoiceViewDelegate? { get set }

Whether or not multiple selection is allowed. Default = NO.
public allowsMultipleSelection Bool { get set }

Whether or not the last selected item can be unselected. Default = YES.
public zeroSelectionAllowed Bool { get set }

An array of RBMultipleChoiceViewOption objects.
public options [RBMultipleChoiceViewOption]? { get set }

The values of the options that are selected.
public selectedValues [String] { get }

The size of the selection cells. Default = 50, 50.
public optionSize CGSize { get set }

The overall positioner used. You may theme this positioner. Default values = spacing = 0, dimensions = 1, margin = [0, 0, 0, 0], orientation = RBOrientationVertical, sizing = RBGridPositionerSizeEvenly.
public positioner RBGridPositioner { get }

Functions

Updates the selection state of the option with the given value.
@param selected : Whether or not to update the option to selected (YES) or unselected (NO).
@param value : The value of the option to update.
- (void)setSelected:(BOOL)selected forOptionValue:(nonnull NSString *)value;

Converts an array of strings to RBMultipleChoiceViewOption options where the value and display text are the same.
@param strings : The list of strings to convert from.
@returns Array of RBMultipleChoiceViewOption options.
+ (nonnull NSArray<RBMultipleChoiceViewOption *> *)options:(nonnull NSArray<NSString *> *)strings;