RSDInputField
public protocol RSDInputField
RSDInputField
is used to describe a form input and includes the data type and a possible hint to how the UI
should be displayed. The ResearchSuite framework uses RSDFormUIStep
to represent questions to ask the user.
Each question must have at least one associated input field. An input field is validated when its owning step
is validated.
Seealso
RSDFormUIStep
-
A short string that uniquely identifies the input field within the step. The identifier is reproduced in the results of a step result in the step history of a task result.
Declaration
Swift
var identifier: String
-
A localized string that displays a short text offering a hint to the user of the data to be entered for this field.
Declaration
Swift
var prompt: String?
-
A localized string that displays placeholder information for the input field.
You can display placeholder text in a text field or text area to help users understand how to answer the item’s question.
Declaration
Swift
var placeholder: String?
-
A Boolean value indicating whether the user can skip the input field without providing an answer.
Declaration
Swift
var isOptional: Bool
-
The data type for this input field. The data type can have an associated ui hint.
Declaration
Swift
var dataType: RSDFormDataType
-
A UI hint for how the study would prefer that the input field is displayed to the user.
Declaration
Swift
var uiHint: RSDFormUIHint?
-
Options for displaying a text field. This is only applicable for certain types of UI hints and data types.
Declaration
Swift
var textFieldOptions: RSDTextFieldOptions?
-
A range used by dates and numbers for setting up a picker wheel, slider, or providing text field input validation.
Declaration
Swift
var range: RSDRange?
-
A formatter that is appropriate to the data type. If
nil
, the format will be determined by the UI. This is the formatter used to display a previously entered answer to the user or to convert an answer entered in a text field into the appropriate value type.Declaration
Swift
var formatter: Formatter?
-
Validate the input field to check for any configuration that should throw an error.
Declaration
Swift
func validate() throws