SMIFormInput

Objective-C

@protocol SMIFormInput <NSObject>

Swift

protocol FormInput : NSObjectProtocol

Represents an input on a form. The type of input is variable based on the form configuration.

  • The text to help explain the purpose of the input.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) NSString *hintText;

    Swift

    var hintText: String? { get }
  • The unique identifier for this input.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) NSString *_Nonnull identifier;

    Swift

    var identifier: String { get }
  • Determines whether this input is required for the form.

    Declaration

    Objective-C

    @property (nonatomic, readonly) BOOL required;

    Swift

    var required: Bool { get }
  • The data type of the input.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) SMIFormInputType _Nonnull inputType;

    Swift

    var inputType: FormInputType { get }
  • The title of this input.

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly) id<SMIFormTitleItem> _Nonnull label;

    Swift

    var label: any FormTitleItem { get }
  • Use this validation to determine if the current value for this input is valid.

    Declaration

    Objective-C

    - (SMIFormErrorType)validate;

    Swift

    func validate() -> FormErrorType