JudoPayInputField

public class JudoPayInputField: UIView, UITextFieldDelegate, ErrorAnimatable

The JudoPayInputField is a UIView subclass that is used to help to validate and visualize common information related to payments. This class delivers the common ground for the UI and UX. Text fields can either be used in a side-by-side motion (title on the left and input text field on the right) or with a floating title that floats to the top as soon as a user starts entering their details.

It is not recommended to use this class directly but rather use the subclasses of JudoPayInputField that are also provided in judoKit as this class does not do any validation which are necessary for making any kind of transaction.

  • The delegate for the input field validation methods

    Declaration

    Swift

    public var delegate: JudoPayInputDelegate?
  • the theme of the current judoKit session

    Declaration

    Swift

    public var theme: Theme
  • Designated Initializer for JudoPayInputField

    Declaration

    Swift

    public init(theme: Theme)

    Parameters

    theme

    the theme to use

    Return Value

    a JudoPayInputField instance

  • Designated Initializer for JudoPayInputField

    Declaration

    Swift

    override public init(frame: CGRect)

    Parameters

    frame

    the frame of the input view

    Return Value

    a JudoPayInputField instance

  • Required initializer set as convenience to trigger the designated initializer that contains all necessary initialization methods

    Declaration

    Swift

    convenience required public init?(coder aDecoder: NSCoder)

    Parameters

    aDecoder

    decoder is ignored

    Return Value

    a JudoPayInputField instance

  • In the case of an updated card logo, this method animates the change

    Declaration

    Swift

    public func updateCardLogo()
  • Set current object as active text field visually

    Declaration

    Swift

    public func setActive(isActive: Bool)

    Parameters

    isActive

    Boolean stating whether textfield has become active or inactive

  • Method that dismisses the error generated in the errorAnmiation: method

    Declaration

    Swift

    public func dismissError()
  • Delegate method when text field did begin editing

    Declaration

    Swift

    public func textFieldDidBeginEditing(textField: UITextField)

    Parameters

    textField

    The UITextField that has begun editing

  • Delegate method when text field did end editing

    Declaration

    Swift

    public func textFieldDidEndEditing(textField: UITextField)

    Parameters

    textField

    the UITextField that has ended editing

  • Checks if the receiving input field has content that is valid

    Declaration

    Swift

    public func isValid() -> Bool

    Return Value

    true if valid input

  • Helper call for delegate method

    Declaration

    Swift

    public func didChangeInputText()
  • Subclassed method that is called when text field content was changed

    Declaration

    Swift

    public func textFieldDidChangeValue(textField: UITextField)

    Parameters

    textField

    the textfield of which the content has changed

  • The placeholder string for the current input field

    Declaration

    Swift

    public func placeholder() -> NSAttributedString?

    Return Value

    an Attributed String that is the placeholder of the receiver

  • Boolean indicating whether the receiver has to show a logo

    Declaration

    Swift

    public func containsLogo() -> Bool

    Return Value

    true if inputField shows a Logo

  • If the receiving input field contains a logo, this method returns Some

    Declaration

    Swift

    public func logoView() -> CardLogoView?

    Return Value

    an optional CardLogoView

  • Title of the receiver input field

    Declaration

    Swift

    public func title() -> String

    Return Value

    a string that is the title of the receiver

  • Width of the title

    Declaration

    Swift

    public func titleWidth() -> Int

    Return Value

    width of the title

  • Hint label text

    Declaration

    Swift

    public func hintLabelText() -> String

    Return Value

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