ORKBooleanAnswerFormat Class Reference

Inherits from ORKAnswerFormat : NSObject
Declared in ORKAnswerFormat.h
ORKAnswerFormat.m

Overview

The ORKBooleanAnswerFormat class behaves the same as the ORKTextChoiceAnswerFormat class, except that it is preconfigured to use only Yes and No answers.

The Boolean answer format produces an ORKBooleanQuestionResult object.

Other Methods

– initWithYesString:noString:

Returns an initialized Boolean answer format using the specified strings for Yes and No answers.

- (instancetype)initWithYesString:(NSString *)yes noString:(NSString *)no

Parameters

yes

A string that describes the Yes answer.

no

A string that describes the No answer.

Return Value

An initialized Boolean answer format.

Declared In

ORKAnswerFormat.h

  yes

The string to describe the Yes answer. (read-only)

@property (copy, readonly) NSString *yes

Declared In

ORKAnswerFormat.h

  no

The string to describe the No answer. (read-only)

@property (copy, readonly) NSString *no

Declared In

ORKAnswerFormat.h

Other Methods

– questionType

The type of question. (read-only)

- (ORKQuestionType)questionType

Discussion

You can use this enumerated value in your Objective-C code to switch on a rough approximation of the type of question that is being asked.

Note that answer format subclasses override the getter to return the appropriate question type.

Declared In

ORKAnswerFormat.h

– impliedAnswerFormat

Some answer formats are constructed of other answer formats. This method allows a subclass to return a different answer format for use in defining the UI/UX for the answer format type. For example, a Boolean answer format is presented in the same way as a single-choice answer format with the choices Yes and No mapping to @(YES) and @(NO), respectively, so its impliedAnswerFormat is an ORKTextChoiceAnswerFormat with those options.

- (ORKAnswerFormat *)impliedAnswerFormat

Declared In

ORKAnswerFormat.h