DateInputField

public class DateInputField: JudoPayInputField

The DateInputField is an input field configured to detect, validate and dates that are set to define a start or end date of various types of credit cards.

  • Boolean stating whether input field should identify as a start or end date

    Declaration

    Swift

    public var isStartDate: Bool = false
  • Variable defining the input type (text or picker)

    Declaration

    Swift

    public var dateInputType: DateInputType = .Text
  • Delegate method implementation

    Declaration

    Swift

    public func textField(textField: UITextField, shouldChangeCharactersInRange range: NSRange, replacementString string: String) -> Bool

    Parameters

    textField

    Text field

    range

    Range

    string

    String

    Return Value

    boolean to change characters in given range for a textfield

  • Check if this inputField is valid

    Declaration

    Swift

    public override func isValid() -> Bool

    Return Value

    true if valid input

  • Subclassed method that is called when textField content was changed

    Declaration

    Swift

    public override func textFieldDidChangeValue(textField: UITextField)

    Parameters

    textField

    the textfield of which the content has changed

  • The placeholder string for the current inputField

    Declaration

    Swift

    public override func placeholder() -> NSAttributedString?

    Return Value

    an Attributed String that is the placeholder of the receiver

  • Title of the receiver inputField

    Declaration

    Swift

    public override func title() -> String

    Return Value

    a string that is the title of the receiver

  • Hint label text

    Declaration

    Swift

    public override func hintLabelText() -> String

    Return Value

    string that is shown as a hint when user resides in a inputField for more than 5 seconds

  • Datasource method for datePickerView

    Declaration

    Swift

    public func numberOfComponentsInPickerView(pickerView: UIPickerView) -> Int

    Parameters

    pickerView

    PickerView that calls its delegate

    Return Value

    The number of components in the pickerView

  • Datasource method for datePickerView

    Declaration

    Swift

    public func pickerView(pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int

    Parameters

    pickerView

    PickerView that calls its delegate

    component

    A given component

    Return Value

    number of rows in component

  • Delegate method for datePickerView

    Declaration

    Swift

    public func pickerView(pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String?

    Parameters

    pickerView

    The caller

    row

    The row

    component

    The component

    Return Value

    content of a given component and row

  • Delegate method for datePickerView that had a given row in a component selected

    Declaration

    Swift

    public func pickerView(pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int)

    Parameters

    pickerView

    The caller

    row

    The row

    component

    The component